Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
debmsarkar123
Contributor III
Contributor III

Dimension vs Current Selections in YTD, MTD

We have a standard YTD expression-

sum({<date=,Year=,Month=,Quarter=, date={">=$(=YearStart(Max(date)))<=$(=Max(date))"}>}Sales)

 

which is for sum of sales. 

My doubt was that we have put date=, which means qlik has to ignore any current selections of Date.

Then later on we are calculating a range of date as in  date={">=$(=YearStart(Max(date)))<=$(=Max(date)) 

this part of the expression.

So if qlik has to ignore the selection of date, how can it calculate YTD since YTD needs a starting date, for example for 14-02-2022 , YTD would be sum of sales from Jan -22 to 14th Feb 2022.

Labels (3)
1 Reply
rwunderlich
MVP
MVP

The date= modifier applies to the Sum(Sales).  There is no set modifier in the Max(date) expression, hence Max(date) will operate on the current selections.

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com