Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
edited.
Can you explain this more with an example?
edited.
@qliklearner11 wrote:
If the actual year (2019) contains 1 month (since we are in January), then show me the sum of sales for 1 month of the last year (2018). Otherwise show me the total sum of sales for 2018 (in the case that 2019 is over).
Which one month of 2018? Dec or Jan? or any random month?
And when you say show total? what exactly do you have as dimension here? Month or what? and that is why asked for an example (some raw data and the expected output from it).
edited.
If you are working with a Calendar in your app, I'd suggest using a flag for CYTD (Current Year To Date) and LYTD (Last Year To Date). This can be achieved with yeartodate or inyeartodate.
This would make your set analysis a whole lot easier as well.