Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ttwward
Contributor
Contributor

Date Comparison in a Straight Table

I am trying to compare the number of records by month to month in a straight table. I would like to show the month's loan count and the previous month loan count, and show the difference, but I can't seem to get the previous month's loan count to calculate. My logic is if the cycle date is 1 month less than the current cycle then count the loan id.

I have...

As Dimensions:

Month

expressions:

Loan count = Count (LOAN_ID)

Previous Month Loan Count = Count (if(num(month(CYCLE_DATE)) - 1, LOAN_ID))

Difference = Previous Month Loan Count - Loan count

Thanks in advance,

Trina

3 Replies
Not applicable

Hi

Best thing to use in this case in the Above() function.

EG:

Previous Month = Above(Count(LOAN_ID))

Difference = Above(Count(LOAN_ID)) - Count(LOAN_ID)

I tried it here on a small sample and it worked fine.

Regards,

Nigel.

ttwward
Contributor
Contributor
Author

Thanks Nigel!. That worked. However, I just added a second dimension to the table, and it didn't work. I added Loan type. How can I make it work with the two dimensions.

Dimensions:

Month

Loan type

Expressions:

Loan Count

Previous Month Loan Count

Difference

Trina

Not applicable

Hello Trina

I'm really not too sure on this one, it might now be better for you to add a new post for this (people tend to mark certain posts as read and therefore don't revist them), so probably best to put in a new one based on your new requirements. I'll continue to work on your example to see if I can find a solution, and I'll of course let you know if I find one.

Regards,

Nigel.