Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Is it possible to have the last 14 days as a dimension on a line chart, updating the dates as the days progress?
Thanks 🙂
Use an expression as the dimension, suppress null values.
=If([DateField] >= Date(Floor(Now()-13),'M/D/YYYY'),Date([DateField],'M/D/YYYY'),Null())
The date format string is dependent on date field.
Use an expression as the dimension, suppress null values.
=If([DateField] >= Date(Floor(Now()-13),'M/D/YYYY'),Date([DateField],'M/D/YYYY'),Null())
The date format string is dependent on date field.
You can create a flag in script instead of calculated dimension to have better performnace.
LOAD ..
if(Date>=today()-13 and Date<=today(),1,0) as Flag_14_Days
FROM table;
then in measure you can use set analysis to restrict the dimension value
=sum({<Flag_14_Days={1}>}Value)
Other option is to create a measure with set analysis.
sum({$<Date={">=$(=Date(today()-14,'$(DateFormat)'))<=$(=Date(today()-1,'$(DateFormat)'))"}>}YourField)
Thanks everyone for their responses 🙂