We are calculating sales metric at Month and Quarter time periods. However, the requirement is to show only latest Month sales in a quarter at the Quarter time period. So when dimension is selected as Quarter, we have to show Sales metric by individual quarter and sales need to show for latest month in that quarter (don't want to sum up all 3-month sales is a quarter)
How can I achieve this by making changes directly in chart expression?
Have a look at the attached QVW. I believe this is what you are looking for. One thing to be aware of is that the table that is being loaded is already sorted by date. If it isn't you'll want to make sure you sort your table.
Just another thought, a well built master calendar could easily be used in this situation adding to the calendar an expression such as what we did in the script. I find that dealing with dates in set analysis is much easier done when you are working with a master calendar.
Thank you, this logic is working. However, instead of If the condition can we write in Set Analysis?
Also, I need Maximum available Month in that Quarter not always picking the 3 month in the quarter. Ex: If we have April data as Max, then in Q2 it should pick the latest Month in the quarter and it will be April.