I’ve got a chart tracking the total value in the SALES columns, filtered by the CLOSE DATE field. Right now, the CLOSE DATE filter is set from March 1 to March 31, showing me the sales that closed in March. There’s also a parameter named PERIOD, which can be set to either MONTH or QUARTER.
I’m looking for a way to adjust the CLOSE DATE filter based on the value in the PERIOD parameter. For example, if I switch the PERIOD parameter to QUARTER, I want the CLOSE DATE filter to automatically update to cover January 1 to March 31.
Is this doable? Or is there another method to achieve the same outcome?
Hey @Andres_Felipe_Restre ,
great to have you in the Quick Sight Community!
One way would be to create a relativ date filter like here:
There you could switch between months/quarters/days etc.
If you want to switch only between current month and quarter i think its easier to do it with a calculated field. My example would be: ifelse(
${pGranularity}=‘month’, ifelse({Order Date}>=${pCMStart} AND {Order Date}<=${pCMEnd}, {Order Date}, NULL),
{Order Date}>=${pCQStart} AND {Order Date}<=${pCQEnd}, {Order Date},
NULL
)
pCM and pCQ are parameter for start and end of the current month and quarter(I used the last 3 month cause i don’t have current dummy data) and a parameter to choose month or quarter.
U can test it here:
month_or_quarter.
Hopefully this can help you. I also think there is a nicer way to write the calculation, maybe someone else has an idea.
BR
Robert