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: 
paulwalker
Creator III
Creator III

need help??

Hi Community,

how to calculate MTD and YTD

MTD:

=Sum({<[Posting Date]={'>=$(=MonthStart(Today()))<=$(=Today())'}>} CLE_Amount)

i am using this expression.. but unable to get values..

Please anyone can help me.....

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Sum({<[Posting Date]={'$(>=MonthStart(Today())<=Today())'}>} CLE_Amount)


the $(= ... must be applied to the whole sub expression


let me know

antoniotiman
Master III
Master III

Hi Paul,

format of Posting Date is DD-MM-YYYY, but in script your DateFormat is D/M/YYYY

You can try

....$(=Date(MonthStart(Today()),'DD-MM-YYYY')))

also in $(=Today())

Regards,
Antonio

paulwalker
Creator III
Creator III
Author

Hi ,

Still i am unable to get values...

jyothish8807
Master II
Master II

Hi Paul,

try like this:

SUM({<Date = , Month =, Quarter = , Date = {">=$(=MonthStart(Today()))<=$(=Today())"}>}Sales) 

will give you Total Sales for Current Month to Date 

SUM({<Date = , Month =, Quarter = , Date = {">=$(=YearStart(Today()))<=$(=Today())"}>}Sales) 

will give you Total Sales For Current Year to Date 

Regards

KC

Best Regards,
KC
antoniotiman
Master III
Master III

See Attachment

maxgro
MVP
MVP

it seems you have different format for the dates, in dimension and in set analysis expression

1.png

try with

=Sum({<[Posting Date]={">=$(=date(MonthStart(Today()),'MM-DD-YYYY'))<=$(=date(Today(),'MM-DD-YYYY'))"}>} CLE_Amount)