Alteryx Designer Desktop Discussions

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

To Re arrange columns as per New quarter

PoliteGolite301991
6 - Meteoroid

Hi All,

 

I have below columns ordered in a way as shown below for Q12024.I have used calendar interface to select the Reporting month and likewise calculations has been done to get the correct Quarter with year appended to it eg Q12024.

 

The present quarter and the previous 4 quarters should be seen

 

ABQ12023Q22023Q32023Q42023Q12024CD
111111111
222222111

 

 

When I run it for next quarter i.e Q22024,the columns below should be ordered in the following way and so on and so forth from Q3 2024:

 

ABQ22023Q32023Q42023Q12024Q22024CD
111111111
222222111

 

 

The problem that I am getting is everytime I run the workflow for the respective Quarter, the Quarter columns are getting reshuffled and I cannot get the exact order as required.

 

Could you please help me to solve this issue on priority ?

 

 

 

7 REPLIES 7
OllieClarke
15 - Aurora
15 - Aurora

Hi @PoliteGolite301991 

I've mocked up an example app here

 

image.png

They key thing is to use a date field as your column headers. These are sorted alphabetically, which with dates is the same as chronologically. You can then create a lookup table of the date to the string, and use a dynamic rename tool to update the names of the columns. This means that the columns will always be in chronological order.

 

Hope that helps,

 

Ollie

jdminton
12 - Quasar

We might need a bit more insight into your workflow and data, but it sounds like there is a crosstab that is reordering the columns.

 

If it is sorting your quarters based on alphabetical, you could name your quarter fields as 2023Q1, 2023Q2, etc. that will sort first by year and the quarter and keep them in order. I've also included a generic workflow that can rename your columns to sort correctly. I think this is the output you're looking for, but you may have to adjust to fit your data coming in. You will also need to perform whatever crosstab is changing your data before the last rename

Snag_a9b5d8b.png 

Snag_a9bed67.png

PoliteGolite301991
6 - Meteoroid

Hi @jdminton & OllieClarke,

 

Thanks for the prompt response.

This is not working in my case.

 

Every quarter the columns must be reordered dynamically ,but with the above two solutions,its not happening.

 

Any other alternatives?

sparksun
11 - Bolide

Any alternative depends on what your data look like, so you'd better provide some sample data for better understanding.

jdminton
12 - Quasar

@PoliteGolite301991 Let me know what is happening with my workflow as there is a little bit of work on your end to connect the data and modify since your column names won't be exactly the same as your sample data.

PoliteGolite301991
6 - Meteoroid

@jdminton

 

There is order in my data and columns both,and when I am using your workflow the data is also getting altered or rather losing its order

jdminton
12 - Quasar

@PoliteGolite301991 I'm not sure what you're saying. Can you provide the actual headers for your columns? The data is irrelevant in this case, but with the actual headers, I can set it up for you to just plug in and run.

Labels