Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
yohann24
Contributor III
Contributor III

Sorting of week over week (WOW) when comparing current vs previous Qtr weekly data

I am preparing a bar graph to show the comparison between the current qtr and previous qtr and the comparison is done by week of the respective quarters. If current qtr is 2017Q1 then previous qtr is 2016Q4. Now I want to show the comparison of week in the graph by week. Ex: 2016 W39, 2017​ W1, 2016 W40, 2017 W2 etc... but the way the graph is now is W39, W40.... W1, W2... or W1, W2.... W39, W40...


so how can I be able to sort them the way I have explained above i.e. (2016 W39), (2017​ W1), (2016 W40), (2017 W2) ....?

Message was edited by: Mannas Jennaa

8 Replies
Anonymous
Not applicable

You can create an inline table in the script with the sort order you want, and join it to your data model.

Then have the object (list box, table, multi box etc.) sort by expression on the field SortOrder

YourTableWithRealValues: 

LOAD 

FieldXX; 

 

LEFT JOIN (YourTableWithRealValues) 

LOAD * INLINE [ 

    FieldXX,    SortOrder 

    2016 W39,      1 

    2017 W1,        2 

    2016 W40 ,     3 

    2017 W2,        4 

]; 

OmarBenSalem

Try the sort by expression

and your expression is somehting like : Year&Week

chandu441
Creator
Creator

Hi Manas Jena,

Even i am also trying the same scenario. Let you know once I got any solution.

Thanks,

Satya

yohann24
Contributor III
Contributor III
Author

Any idea how to make this dynamic as we have to change it every year

yohann24
Contributor III
Contributor III
Author

Tried this but no luck.

yohann24
Contributor III
Contributor III
Author

Thanks Chandra and appreciate your concern.

karthiksrqv
Partner - Creator II
Partner - Creator II

Try using this as your sorting expression:

Year & if(len(mod(purgechars(Week,'Wk'),13))<2,'0'&mod(purgechars(Week,'Wk'),13),mod(purgechars(Week,'Wk'),13))

The expression is assuming that you have a 52-week calendar and that there are 13 weeks per quarter. It is then converting it to a number between 0 and 12.

yohann24
Contributor III
Contributor III
Author

Appreciate your response Karthik but its not working as desired.