Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
qw_johan
Contributor

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
Valued Contributor II

Re: Problem calculating net change month to month

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

Re: Problem calculating net change month to month

would you be able to share the sample?

qw_johan
Contributor

Re: Problem calculating net change month to month

Hi

Thanks for your fast respons.

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

Skärmklipp.PNG

Re: Problem calculating net change month to month

try this

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

qw_johan
Contributor

Re: Problem calculating net change month to month

Fantastic !!!

Using "total" solved the problem.

Thank you