Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
narband2778
Creator II
Creator II

Sorting Weekday Dynamically

Hello Everyone,

 

Want to sort Weekday in a given chart should be driven by Today() function:

 

For example:

If Today() is Wednesday  the Chart  "Week Day" Dimension should start with 'Thu', 'Fri', and so on.

If Today() is Thursday the chart  "Week Day" Dimension should start with 'Fri', 'Sat', and so on.

 

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

try like this:

Load *, Mod(Nr -(Day(Today(1))+2),7)+1 as Test;
TEST:
LOAD * Inline [
Day, Nr
Mon, 1
Tue, 2
Wed, 3
Thu, 4 
Fri, 5
Sat, 6
Sun, 7
];

and then use "Test" for sorting.

 

hope this helps

View solution in original post

2 Replies
Frank_Hartmann
Master II
Master II

try like this:

Load *, Mod(Nr -(Day(Today(1))+2),7)+1 as Test;
TEST:
LOAD * Inline [
Day, Nr
Mon, 1
Tue, 2
Wed, 3
Thu, 4 
Fri, 5
Sat, 6
Sun, 7
];

and then use "Test" for sorting.

 

hope this helps

narband2778
Creator II
Creator II
Author

Thanks Frank. Worked pretty well.