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: 
Averageuser
Contributor
Contributor

Calculating MOM

I am creating a table with

FullDate Txnamount PrevDate MOM%
2024-04-01 $5000 2024-03-01 150

2024-03-01 $2000 2024-02-01 33

2024-02-01 $1500 2024-01-01 -

 

however when adding measure for MOM, it is not returning any value. Am new to set expressions

This was set expression I applied

(sum([txnamount])/ sum({FullDate.autoCalender.Date) = {“$(=Date(AddMonths(FullDate.autoCalendar.Date, -1))”}>} [atmtxnamt]) ) -1

 

Labels (3)
3 Replies
HirisH_V7
Master
Master

If Your using months in Dimension, Try Below:

sum(aggr(
(sum({<Month>}Measure)-above(sum({<Month>}Measure)))
/
above(sum({<Month>}Measure))
,Month))

Else, pls share your sample data and output.

HirisH
“Aspire to Inspire before we Expire!”
Averageuser
Contributor
Contributor
Author

Hi Hirish thanks for your solution. However results are not returning correctly. 

sample data

FullDate Month Year Txnamount 
2024-04-01 Apr 2024  $2500

2024-04-01 Apr 2024  $1500

2024-04-01 Apr 2024  $1000

2024-03-01 Mar 2024 $1000

2024-03-01 Mar 2024 $1000

2024-02-01 Feb 2024 $500

2024-02-01 Feb 2024 $1000

Full date will always return first day of the month.

I have tried calling above(sum({<FullDate.autoCalendsr.Date>}[txnamount]))

but it’s returning blank 

 

HirisH_V7
Master
Master

Hope you have created  MonthName(FullDate) as MonthName in script, then use this as dimension.

 

This will be the expression:

Sum(Txnamount)/
above(sum(Txnamount))
HirisH
“Aspire to Inspire before we Expire!”