Cathy Liu
03/05/2025, 5:31 AMMauricio Cabezas
03/05/2025, 1:07 PMCathy Liu
03/06/2025, 2:17 AMMauricio Cabezas
03/06/2025, 4:06 PMCathy Liu
04/08/2025, 3:27 AMmax_date
and then show the turnover trend for that day across the past 52 weeks. eg. max_date is 2025-04-07, the day of week is Monday. I want to have a line chart for each Monday of last 52 weeks. Like snapshot below:Cathy Liu
04/08/2025, 3:53 AMCathy Liu
07/11/2025, 1:06 AMMauricio Cabezas
07/15/2025, 7:11 AMMauricio Cabezas
07/15/2025, 8:18 AMSELECT
#Day
(DATETIME_DIFF(MAX({label/SaleDate.month},{dataset/salesdata}),
MAX({label/SaleDate.day}, {dataset/salesdata})) + 1) * 100 +
#Month
(DATETIME_DIFF(MAX({label/SaleDate.year}, {dataset/salesdata}),
MAX({label/SaleDate.month}, {dataset/salesdata})) + 1) * 10000 +
#year
DATETIME_DIFF("2000", MAX({label/SaleDate.year}, {dataset/salesdata}), YEAR)
An, if you want, for example a specific month or year, just change the numbers as follow:
SELECT
#Day
(DATETIME_DIFF(MAX({label/SaleDate.month},{dataset/salesdata}),
MAX({label/SaleDate.day}, {dataset/salesdata})) + 1) * 100 +
#Month (March example)
3 * 10000 +
#year (20XX)
25
This will returns date encoded as number in format MMDDYY
The most important, you need to change the custom format as:
[<20000]{{{100|100|00}}} Jan \2\0{{{|100|00}}};
[<30000]{{{100|100|00}}} Feb \2\0{{{|100|00}}};
[<40000]{{{100|100|00}}} Mar \2\0{{{|100|00}}};
[<50000]{{{100|100|00}}} Apr \2\0{{{|100|00}}};
[<60000]{{{100|100|00}}} May \2\0{{{|100|00}}};
[<70000]{{{100|100|00}}} Jun \2\0{{{|100|00}}};
[<80000]{{{100|100|00}}} Jul \2\0{{{|100|00}}};
[<90000]{{{100|100|00}}} Aug \2\0{{{|100|00}}};
[<100000]{{{100|100|00}}} Sep \2\0{{{|100|00}}};
[<110000]{{{100|100|00}}} Oct \2\0{{{|100|00}}};
[<120000]{{{100|100|00}}} Nov \2\0{{{|100|00}}};
{{{100|100|00}}} Dec \2\0{{{|100|00}}}
And you will get something like (attached)
Give it a try and let me know 🙂Cathy Liu
07/15/2025, 11:24 PM