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

Thanks a lot i will try and tell i hope it works

ahmar811
Creator III
Creator III

Hi

vijay krishna

if you have Month field please try this expression


Sum({<Month= {"$(=Month(Max(Date))-1 )"}>}Sales)


hope this help you


Thanks & Regards

Ahmar Ansari

Not applicable
Author

this is one is fine but instead of today i want last date in my records. for that max (Date) we can use ....but here in this variable how can use max (Date)

amayuresh
Creator III
Creator III

Hi Vijay,

Try this expression for last date if your Filter is Order Date

=sum({<OrderDate={'$(=monthend(Addmonths(OrderDate,-1)))'}>}TotalDue)

tresesco
MVP
MVP

You mean, like:

vRecentMostMonthEnd =If(max(Floor(Date))=Floor(Monthend(Today())), Date(Max(Date)), MonthEnd(Today(),-1))

Not applicable
Author

ya but can we write the condition without today() function.

tresesco
MVP
MVP

Certainly, I just missed that. May be:

vRecentMostMonthEnd =If(max(Floor(Date))=Floor(Monthend(Today())),Date(Max(Date)), MonthEnd(Max(Date),-1))

amayuresh
Creator III
Creator III

=sum({<OrderDate={'$(=monthend(Addmonths(OrderDate,-1)))'}>}TotalDue)

This works for you using Order Date List box

Not applicable
Author

ya correct one when i take that if expression in text area it's working fine giving correct date...but when i use in set expression showing 0.000 value

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

in expression =sum({<BILLDATE={'$(vRecentMostMonth)'}>}StockClosing_GROSSWEIGHT)

Stockclosing_date is floor(BILLDATE)

BILLDATE is normal date field

Not applicable
Author

Thanks Mayuresh the condition is correct but for my expression it's giving zero value....

i am taken your condition in text area it's working fine with small change   '=max(MonthEnd(Addmonths(Date,-1)))'

when i use for my measure it's giving zero value...