Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ishansjain2095
Creator
Creator

How to find out MTD Month to Date and LMTD Last Month to Date expression in Qlik Sense?

Hi All,

I am getting confused with below expression which is for :

MTD- Month to Date-> Expression:

Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num(MonthStart(Max(DateNum))))<=$(=Max(DateNum))"}>} Sales)

From above expression I have Year, Month, Quarter as fields but week as function and datefield as date<field>, datenum as Ddate<field> and when I run this expression in pivot table it shows me all dates from previous month to current month.

But MTD, means to get data of current month sales within that current month dates, not previous month dates.....

Same As LMTD facing the issue.

Labels (2)
2 Replies
jwjackso
Specialist III
Specialist III

Do you have any sales that are in August or is Max(DateNum) a July date?

ishansjain2095
Creator
Creator
Author

Hi Jwjackso,

I actually found a solution using expression addmonths(monthstart) and addmonths(monthend) to get current month date sales details as MTD and previous month date sale details as LMTD.

But mainly facing a major problem with background expression like in dimension field I have current date for example like Aug2020(1st-20th) dates and want like high/low values in sale details(values are in measure field). Want to show 'Green' background color as 'High sale value' and 'Red' background color as 'Low sale value'.

What can be the expression I can use to write in background field to compare date wise <measure field values> sale details?