Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YTD based on selections

Dear all,

I am currently working on a solution that I need your help to solve.

We want to be able to select on year (År), month(Måned), quarter(kvaral). When doing these selections we want to present numbers for the period chosen YTD. In other words, if I do a selection on 2013 and march I want to see, jan feb and march for 2013. I found the below z-analysis.

sum({<MånedÅr={'>=$(=date(yearstart(max(MånedÅr)),'MM-YYYY')) <=$(=date(max(MånedÅr),'MM-YYYY'))'}>}FaktBeløp)

This expression enables me to do a selection in the below list box(månedår).

I also want to be able to perform selections in all calendar fundtions (all).

In advance, thanks 

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this, if you have date dimension in your datamodel

=Sum({<YearDimension=, MonthDimension=, DateDimension={'>=$(=YearStart(Max(DateDimension)))<=$(=Max(DateDimension))'}>} MeasureName)

Regards,

Jagan.

View solution in original post

3 Replies
Gysbert_Wassenaar

This ought to do it, assuming I got the field names right:


sum({<År=, Halvår=, Kvaral=, MånedÅr={'>=$(=date(yearstart(max(MånedÅr)),'MM-YYYY')) <=$(=date(max(MånedÅr),'MM-YYYY'))'}>}FaktBeløp)


Selections in the fields will still influence the max function to get the correct maximum MånedÅr of the possible values. But those selections won't influence the sum. Only MånedÅr will do that.


talk is cheap, supply exceeds demand
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this, if you have date dimension in your datamodel

=Sum({<YearDimension=, MonthDimension=, DateDimension={'>=$(=YearStart(Max(DateDimension)))<=$(=Max(DateDimension))'}>} MeasureName)

Regards,

Jagan.

Not applicable
Author

Thanks! Worked perfectly!