Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
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. 

 

 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

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
tresesco
MVP
MVP

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)
tresesco
MVP
MVP

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+