Skip to main content

# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for
Search instead for
Did you mean:
Creator III

## Limit the total amount of expression

Good morning.

I have a table where I have two fields that are grouped with their values.

Need to group on a chart table, the total price never pass 900.00.

If you arrive to 900.00 is created a new line with the rest and so on.

If we were to limit for number of records could use a field with "div (rowno (), 900) + 1 the Group", but I'm willing to limit the sum of the values.

Can someone help me?

1 Solution

Accepted Solutions
Employee

Good correction

A better solution

rangemax(0,rangemin(900,Sum(F3)-(ValueLoop(1,10)-1)*900))

9 Replies
Employee

Please find attached one possible solution

MVP

Clever Anjos‌ I think this would need to be dynamic as what happens if this is the data:

LOAD * INLINE [

F1, F2, F3

13, 90, 100

13, 90, 200

13, 90, 100

13, 90, 600

13, 90, 100

13, 90, 200

13, 90, 100

13, 90, 600

];

Correct me if I am wrong Marcio Arruda‌‌, but I think the solution then would be 900, 900, 200 in three rows

Employee

Good correction

A better solution

rangemax(0,rangemin(900,Sum(F3)-(ValueLoop(1,10)-1)*900))

MVP

Super with the second dimension changed to ValueLoop(1, 10)

Creator III
Author

First, thank you for your response.

I understand, but when you use really will not know beforehand what the total values nor how many rows will need to complete the full amount. Which lists need to be dynamic.

I made some changes and is an example where choosing jurisdiction is 12/2015 the value of the third row is negative.

Creator III
Author

Corrigir Sunny T

Creator III
Author

This solution is best.

Employee

We need to set a maximum, for example 100.

You can extrapolate, to 1.000 or 10.000, at the cost of performance

Creator III
Author

I understood Clever Anjos, but the way you did has served me.

Thank you so much.

Community Browser