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: 
Not applicable

Latest Month EndDate Sales only

hi guys i want to get the latest month end date sales only that means, if present month is march 8 in that case i need to get feb 29 sales.

Can any one help how to achieve that in expression sum(Sales)

Thanks in advance!

Vijay

25 Replies
amayuresh
Creator III
Creator III

Try this expression =sum({<BILLDATE={'$(=monthend(Addmonths(Max(BILLDATE),-1)))'}>}StockClosing_GROSSWEIGHT)

This works for me

tresesco
MVP
MVP

Could you post a sample qvw?

MayilVahanan

Hi

Try like this

=sum({<BILLDATE={'$(=vRecentMonth)'}>}StockClosing_GROSSWEIGHT)


Check both vRecentMostMonth is same date format like Bill Date.

If it not there,


vRecentMonth=date(If(max(Floor(StockClosing_DateNum))=Floor(Monthend(num(Today()))),num(Max(StockClosing_DateNum)), MonthEnd(Max(StockClosing_DateNum),-1)),'YourBillDateFormat')

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Digvijay_Singh

Mostly when something is working in text box but not working in straight table/chart means there could be a granularity mismatch between dimension selected and dimension used in expression. If you can post sample data/app, that will help.

Not applicable
Author

Thanks a lot tresesco‌ i got the solution

in expression alone

=sum({1<NumDate ={'$(=floor(num(max(MonthEnd(AddMonths(NumDate,-1))))))'} >}SCMSTOCK_GROSSWEIGHT)

Not applicable
Author

thanks alot to all

i got the solution

=sum({1<NumDate ={'$(=floor(num(max(MonthEnd(AddMonths(NumDate,-1))))))'} >}SCMSTOCK_GROSSWEIGHT)

This condition will give last month last for selected month

=floor(num(max(MonthEnd(AddMonths(NumDate,-1)))))