Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sagaraperera
Creator
Creator

last month value

dear all

i already get a last year selected month value using given below formula 

sum( {$<YEAR = {"$(=Only([YEAR]-1))"},CLA_CODE= {'M3'}>} [GROSSTOT] )

now i want get a last month value , pls help me

 

sagara

3 Replies
MohammedMustaq
Partner - Creator
Partner - Creator

 

Try this

Last Month:

=Sum({<CLA_CODE= {'M3'},MonthYear={'$(=MonthName(MonthStart(Max(Date))-1))'}>}[GROSSTOT])

make sure you have Monthyear field

Thanks

Mustaq

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Try this:

Last Month.PNG

sum({<Month={"$(=month(AddMonths(max(<date>),-1,0)))"},<date>=,CLA_CODE= {'M3'}>}  [GROSSTOT])

Replace <date> to your date column in data model.

Be sure you have Month column defined in your data model.

If Month is not defined, refer qvw attached as reference.

Thanks and regards,

Arthur Fong

 

 

Brett_Bleess
Former Employee
Former Employee

Sagara, did either of the posts get you what you needed?  If so, please be sure to return to the thread and use the Accept as Solution button on the one(s) that did help you get things working.  If you did something else, consider posting that and then mark it, so others will know what actually worked.  If you still need further assistance, please leave an update for us.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.