Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Add to Running Total when condition met?

Hello --

I need to generate a running total. The total will remove values from a static qty. When the running total dips below a certain level, it needs to add a predefined number to the running total to keep it from going negative.

The goal of the running total is to stay above a certain #.

How can this be achieved in Qlik?

Example:

Running TotalDescription
6000Starting Qty
5000
4000
3000
2000
1000Minimum reached - automatically add 1000
2000
1700
1300
1000Minimum reached - automatically add 1000
2000
1900
1800
Labels (1)
12 Replies
settu_periasamy
Master III
Master III

Hi,

Can you try the below attached

Anonymous
Not applicable
Author

Hi Settu --

Thank you, this seems to be working as expected now.

One other question that is somewhat related. Do you think it would be possible to use a time variable as well to determine when the qty should be added? For example, the data table reduces and adds the qty when it reaches below a value. But what if I only want to add that value if it was X # of days after the last time it reached that value.


Example:

settu_periasamy
Master III
Master III

You can try this...

Create a Variable, and use that variable in your expression like Mod(RowNo(),vPassedDays)

PFA for reference.