Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Sorting dymanic date columns

Sohdaw
8 - Asteroid

Hi,

 

I have a workflow where i have independently set a formula for the date from T-1 to T+5, then use a join tool to look up the date in my dataset. I also have a sum tool then cross tab it to present it in columns. 

 

Account numberSum of T-1Sum of TSum of T+1Sum of T+2Sum of T+3Sum of T+4Sum of T+5 
abc-12345-12345 -12345 -12345 -12345 -12345 -12345
erf567       567567       567       567       567       567       
sdf246246246246246246 246

 

How do i ensure that the dates will always come up in this format of T-1 to T+5? In the past few days given that it has crossed from Mar to Apr, my date columns are coming up as eg. Sum of T+4, Sum of T+5, Sum of T-1, Sum of T, Sum of T+1, Sum of T+2, Sum of T+3. 

 

I have tried using a sort tool before the cross tab to sort the date, which i have as a separate column to the string (eg. sum of T), but once the cross tab tool hits the date columns are still in jumbled up format.

 

Thanks 

1 REPLY 1
martinding
13 - Pulsar

Hi @Sohdaw

 

1. (After sorting the dates) Try adding a Record ID Tool and use a Formula Tool to concatenate the Record ID's value with your Date (both as strings).

2. So something like: ToString([RecordID])+ "_" + ToString([Date])

3. Then we you do the Cross Tab, it will go in order from the smallest to the last (based on the value of the Record ID that appears in front).

 

You can use a dynamic rename tool in the end to format the column names to your liking.

martinding_0-1680159113251.png

 

Labels
Top Solution Authors