Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Ilze1
Contributor
Contributor

Ignoring day selection from date field

I hope someone can help with this. I am trying to create a set expression to ignore only the day selection out of a date variable. The intention is that the user will select a particular date using the date picker which will then in the KPIs show data for that date, but that a line graph on the same sheet of the dashboard will continue to show the trend in data for the month and year that was selected over all days in the month.

I have tried creating a variable that contains the month that was selected and ignoring the Date field, but that then just results in the metric ignoring all the entirety of date: sum({<[Date.autoCalendar.Month]=${'vMonth'}, Date>} Metric)

1 Solution

Accepted Solutions
sunny_talwar

If you look closely, your set analysis condition is not even getting used here

Capture.PNG

Try this

Sum({<[Date.autoCalendar.Month]={'$(=$(vMonth))'}, Date>} Metric)

View solution in original post

6 Replies
sunny_talwar

Are you looking to do this?

Sum({<[Date.autoCalendar.Month] = {"$(vMonth)"}, Date>} Metric)
Ilze1
Contributor
Contributor
Author

 Hi Sunny

Thanks for the quick response, if I use the expression you suggested I get a 0 . . .

sunny_talwar

The original expression was working in a sense it gave you a number?

Ilze1
Contributor
Contributor
Author

Hi - yes it does, the problem is that the answer is then provided for all months even when vMonth is only equal to the month that was selected via the date picker. I have created an example of what happens in the attached using some dummy data

sunny_talwar

If you look closely, your set analysis condition is not even getting used here

Capture.PNG

Try this

Sum({<[Date.autoCalendar.Month]={'$(=$(vMonth))'}, Date>} Metric)
Ilze1
Contributor
Contributor
Author

Hi Sunny

 

If I use the suggestion you just gave to a different user re set analysis with variable, it works!

{"$(=$(vteste))"}

So thanks for solving my problem in an indirect way 🙂

This works: sum({<[Date.autoCalendar.Month]={"$(=$(vMonth))"}, Date>} Metric)