Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bhaveshp90
Creator III
Creator III

Set Analysis for Current month Value minus Previous month Value

Hello,

I have the table as shown below;

1.PNG

I am trying to calculate the MTD Variance which is (Current month YTD) - (Previous month YTD) with the expression as;


Sum(YTD)

-

Sum({$< Snapshot_Date = {$(vPreviousMonth)}>}YTD)

where PreviousMonth is a variable defined as

Let vPreviousMonth = '=MonthEnd(AddMonths((Snapshot_Date),-1))';

The above expression returns null values, what wrong am I doing here? any help is appreciated

thanks

15 Replies
sunny_talwar

Check attached.... you don't need set analysis here... but Inter-Record Functions

bhaveshp90
Creator III
Creator III
Author

Ah, thank you stalwar1‌ for the information. This is what I am looking for

bhaveshp90
Creator III
Creator III
Author

stalwar1‌ when we use Above() here it is calculating per row basis (current row minus previous row) not considering the project numbers and country selected. Any idea on how to avoid this?

1.PNG

sunny_talwar

Can you share this in a qvw file and also make sure to provide the expected output

bhaveshp90
Creator III
Creator III
Author

stalwar1‌ Since this thread has been closed I have created another question. Please find the link here Calculate current month YTD minus previous month YTD

thank you

sunny_talwar

Okay, looking at that now