Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Amiran_D
Contributor
Contributor

How to show data point in weeks or month gap in line chart

Hi,
I want to create a line chart that shows the last 20 data points in 7 days or month gaps.

for example, If a user selects "Weeks" and the date  29/09/21 in the date picker then the data will show the date: 29/09 ,22/09, 15/09,8/09 ...

if they will select 28/09/21 then:28/09 ,21/09, 14/09,7/09.... and so on...

I found out I can do this if I create a flag in the script for a specific day but I need to be dynamic per the selection

the data points should be dynamic as well so if a user selects the 28/09 it will show 20 weeks back and not from the max date (like an interval window that move per selection)

in the image you can see the result I have now but this is just for a specific date in the script,

the dimension is: FREEZ_DATE and 

the set analysis is: 

avg({<[Last$(=^Diff)DayFlag]={1},[$(=^DateDiff)]={">=$(=Max([$(=^DateDiff)]-19))<=$(=Max([$(=^DateDiff)]))"},FREEZE_DATE>} SCORE)

 

Amiran_D_1-1633244104466.png

 

Amiran_D_0-1633243858643.png

 

0 Replies