Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
wcilliers
Partner Ambassador
Partner Ambassador

Cumulative Sum with condition

Hi Experts,

I need some help with doing a cumulative sum on a pivot table. This sum would be to calculate when a customer's payment is due. This is done by week. I would like to display the following 4 weeks, from today, and have overdue payments fall into the current week.

Currently this is what the actual result looks like.

Table1:

1.jpg

This is the outcome I am aiming for.

Table2:

2.jpg

I assume that this might be something I need to calculate within the script, perhaps adjust the due date when I load the data?

 

Any help would be appreciated.

Thanks,

Wynand

Labels (1)
1 Solution

Accepted Solutions
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi,

Maybe try to adjust your WeekDue dimension to an expression:

If(WeekDue<=Week(Today()), Week(Today()), WeekDue)

* Beware that from the performance perspective, calculated dimensions are not recommended.

View solution in original post

2 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi,

Maybe try to adjust your WeekDue dimension to an expression:

If(WeekDue<=Week(Today()), Week(Today()), WeekDue)

* Beware that from the performance perspective, calculated dimensions are not recommended.

wcilliers
Partner Ambassador
Partner Ambassador
Author

Thank you. That works.

To be honest, I did not expect the measure to calculate accordingly.

Thanks Again,

Wynand