Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

If expression showing sum in proportion to current periods

 

edited. 

Labels (2)
5 Replies
Highlighted

Can you explain this more with an example?

Highlighted
Contributor
Contributor

edited.

Highlighted


@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).

Highlighted
Contributor
Contributor

 

edited. 

Highlighted
Specialist
Specialist

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.