Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
letileti
Contributor III
Contributor III

How to calculate amount last month end - 1

Dear all

I am hoping that someone on this forum can help me with this calculation.

Let's assume my data looks like:

Request Month, Amount

Jan, 100

Feb, 50

..

Sep, 300

Oct, 150

The total Amount until end of Oct = 600.

Now, I want to add a calculation to get the "Amount until end of Sep" = 450.

=> to display the last month end I used: Month (MonthEnd (AddMonths (Today(),-1))) which results in Oct.

=>  then, I try to create a measure that sums the Amount until Month (MonthEnd (AddMonths (Today(),-2))) but didn't succeed.

Anyone who can help me with the correct syntax?

Many thanks in advance!

1 Reply
MK9885
Master II
Master II

if(InMonthToDate(TempDate, today(),-1), 1, 0) as [Previous Month], -- OCT
if(InMonthToDate(TempDate, today(),-2), 1, 0) as [Previous 1stMonth],-- SEP
if(InMonthToDate(TempDate, today(),-3), 1, 0) as [Previous 2ndMonth] -- AUG
But these are all static months for 2018 only and written in back end