cancel
Showing results for
Did you mean:
Highlighted
Partner

## 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:

This is the outcome I am aiming for.

Table2:

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

Tags (4)
Labels (1)
• ### qlik sense

1 Solution

Accepted Solutions
Highlighted
Partner

## Re: Cumulative Sum with condition

Hi,

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

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

2 Replies
Highlighted
Partner

## Re: Cumulative Sum with condition

Hi,

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

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

Highlighted
Partner

## Re: Cumulative Sum with condition

Thank you. That works.

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

Thanks Again,

Wynand