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

Problem calculating net change month to month

Hi

Having problem with my expression trying to calculate net change month to mounth. I am getting null value on first and second row, first row I can understand but why the second row?

Skärmklipp.PNG

Total amout = Just calculates the number of ID's for a certain period/month.

count({<Period={">=$(=$(vYearMonth))"}>}DISTINCT ID)

Net change = the difference month to month, i.e. april= april - march, 19752-19820= -68

count({<Period={">=$(=$(vYearMonth))"}>}DISTINCT ID) - above(count({<Period={">=$(=$(vYearMonth))"}>}DISTINCT ID))

I am stuck and can't figure this out.

Any help appreciated

Thanks

5 Replies
techvarun
Specialist II
Specialist II

Hi,

The Problem seems to be in  Variable Declaration 1701 is not taking the Above Value as 1612, where as 1702 for feb is taking 1701 as Above Properly.

Can you Check. Or share a sample app

Kushal_Chawda

would you be able to share the sample?

qw_johan
Creator
Creator
Author

Hi

Thanks for your fast respons.

I have created a sample app that illustrates the problem: Test.qvw

Skärmklipp.PNG

Kushal_Chawda

try this

num(count({<Period={">=$(=$(vYearMonth))"}>}DISTINCT ID) - above(total count({<Period={">=$(=$(vYearMonth))"}>}DISTINCT ID)),'# ##0','.',' ')

qw_johan
Creator
Creator
Author

Fantastic !!!

Using "total" solved the problem.

Thank you