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: 
niharikab
Contributor II
Contributor II

MTD

Hi Experts,

Can any one please help me to exclude month and Year fields from the below set expression of MTD.

sum({<Year=,month=,
[Order Date]= {">=$(=Date(MonthStart(max([Order Date])),'MM/DD/YYYY')) <=$(=Date(max([Order Date]),'MM/DD/YYYY'))"}>}Sales)

Here i applied Year= and month= but i am unable to exclude month and year.Still selections are applied when i select 2012,2013...yearsMTD.png

Please help me on this.

Thanks in advance. 

 

 

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Try like:

sum({<Year=,month=,
[Order Date]= {">=$(=Date(MonthStart(max({<Year=,month=>} [Order Date])),'MM/DD/YYYY')) <=$(=Date(max( {<Year=,month=>} [Order Date]),'MM/DD/YYYY'))"}>}Sales)

View solution in original post

3 Replies
tresB
Champion III
Champion III

You need to include this exclusion in max() being used in the expression as well, like:

sum({<Year=,month=,[Order Date]= {">=$(=Date(MonthStart(max( {<Year=,month=>} [Order Date])),
'MM/DD/YYYY')) <=$(=Date(max({<Year=,month=>} [Order Date]),'MM/DD/YYYY'))"}>}Sales)
tresB
Champion III
Champion III

Try like:

sum({<Year=,month=,
[Order Date]= {">=$(=Date(MonthStart(max({<Year=,month=>} [Order Date])),'MM/DD/YYYY')) <=$(=Date(max( {<Year=,month=>} [Order Date]),'MM/DD/YYYY'))"}>}Sales)

albert_guito
Creator II
Creator II

HI,

If you select a month or a year your [Order Date] will refer to this period.

If you need the current MTD you have to change the Order Date by Today() in the set analysis

sum({<Year=,month=,
[Order Date]= {">=$(=Date(MonthStart(Today())),'MM/DD/YYYY')) <=$(=Date(Today(),'MM/DD/YYYY'))"}>}Sales)

Ag+

Ag+