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: 
angelompcunha
Contributor III
Contributor III

Display last 6 months of data when no date is selected in the calendar

I have a calendar object, with dates in YYYY-MM format, where users will select a data range to display the data on the charts, in this case the count of incidents raised with a specific priority for that time period.

At this point I have:

As dimension: MONTH_RAISED (Date in YYYY-MM format) 

As Measure: =count({<TICKETPRIORITY={'Prio2'}>}TICKETID)

What I want to accomplish is if the users have select a date range in the calendar to have the charts showing the data for that time period ( this is working already ) but if no date range is selected in the calendar than the charts will show the last 6 months of data by default

I've been trying with the GetFieldSelections() function but can't get it to work.

Labels (2)
1 Solution

Accepted Solutions
Mark_Little
Luminary
Luminary

I think you would want

IF(getselectedcount(MONTH_RAISED) => 1 ,

count({<TICKETPRIORITY={'Prio2'}>}TICKETID),

.....)

I would personally flag the 6 month period in script and use that in the set analysis for the last 6 months

 

View solution in original post

2 Replies
Mark_Little
Luminary
Luminary

I think you would want

IF(getselectedcount(MONTH_RAISED) => 1 ,

count({<TICKETPRIORITY={'Prio2'}>}TICKETID),

.....)

I would personally flag the 6 month period in script and use that in the set analysis for the last 6 months

 

angelompcunha
Contributor III
Contributor III
Author

That actually makes much more sense and would avoid causing extra load on the application due to the calculation.

Thanks for the tip