Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewaf
Creator
Creator

MTD for Previous Year

Hi Guys,

i have been read all forum but i got no solution for my previous  month to date.

i'm using this formula on the column (MTD 2016) but is not working

Sum({<Area-={'Area-not-available'},Year=, Quarter=,  Week=,Day=,Invoice_Date_Num=, Invoice_Date_Num={">=$(=Num(MonthStart(addyears(Max(Invoice_Date_Num),-1))))<=$(=addyears(Max(Invoice_Date_Num),-1))"}>}

ExtendedUSD)

In the example attached the column MTD 2016 should be, selecting 13 june 2017 , 584 $ but i got 2419 $.

How this can be adjusted? What i'm doing wrong?

Thank you

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

=if(vExcludeInstrumentSales,

Sum({<Area-={'Area-not-available'},Year=, Quarter=,  Week=,Day=,Invoice_Date_Num=, Invoice_Date_Num={">=$(=Num(MonthStart(addyears(Max(Invoice_Date_Num),-1))))<=$(=Num(addyears(Max(Invoice_Date_Num),-1)))"}>}

ExtendedUSD),

Sum({<Area-={'Area-not-available'},Year=, Quarter=, Week=,Day=,Invoice_Date_Num=, Item_Category={$(vNoInstruments)}, Invoice_Date_Num={">=$(=Num(MonthStart(addyears(Max(Invoice_Date_Num),-1))))<=$(=Num(addyears(Max(Invoice_Date_Num),-1)))"}>}

ExtendedUSD))/1000

You forgot to change the date format to Num in the <= exp

View solution in original post

2 Replies
aarkay29
Specialist
Specialist

=if(vExcludeInstrumentSales,

Sum({<Area-={'Area-not-available'},Year=, Quarter=,  Week=,Day=,Invoice_Date_Num=, Invoice_Date_Num={">=$(=Num(MonthStart(addyears(Max(Invoice_Date_Num),-1))))<=$(=Num(addyears(Max(Invoice_Date_Num),-1)))"}>}

ExtendedUSD),

Sum({<Area-={'Area-not-available'},Year=, Quarter=, Week=,Day=,Invoice_Date_Num=, Item_Category={$(vNoInstruments)}, Invoice_Date_Num={">=$(=Num(MonthStart(addyears(Max(Invoice_Date_Num),-1))))<=$(=Num(addyears(Max(Invoice_Date_Num),-1)))"}>}

ExtendedUSD))/1000

You forgot to change the date format to Num in the <= exp

qlikviewaf
Creator
Creator
Author

monster! finally works