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: 
ZuhaibRana
Partner - Contributor III
Partner - Contributor III

Not showing current month total in kpi MTD

i have created Mtd using this formula

Sum({<MonthNumber={"<=$(=(max(MonthNumber)))"},Month=>} Value)

its working fine when i select march its also sum jan,feb and march when i do not select any month its showing 12 month sales in kpi but i want its show current month sales value in kpi without any selection

 

Qlik Sense Business Qlik Sense Desktop Qlik Sense Mobile Qlik Sense Enterprise on Windows 

3 Replies
Chanty4u
MVP
MVP

Add 1 to expression

Sum({1<MonthNumber={"<=$(=(max(MonthNumber)))"},Month=>} Value)

 

Or this 

Sum({<MonthNumber={"$(=max(MonthNumber))"}, Month=>} Value)

 

ZuhaibRana
Partner - Contributor III
Partner - Contributor III
Author

both are not showing  sum of till current month 

vinieme12
Champion III
Champion III

MTD would be Current Month only, but your use case of selecting March and showing Totals of Jan,Feb & Mar is actuall YTD !

 

I would stick to using the Date field ,  for both MTD and YTD

 

MTD :  latest month by default or Selected month

Sum({<Datefield = {">=$(=Date(MonthStart(Max(Datefield ))))<=$(=Date(Max(Datefield )))"} >} Value)

 

YTD:  Year to Date by default or Year to Date until selected Date/Month

Sum({<Datefield = {">=$(=Date(YearStart(Max(Datefield ))))<=$(=Date(Max(Datefield )))"} >} Value)

 

replace Datefield with your actual date field name

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.