# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Contributor 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?

Tags (4)
1 Solution

Accepted Solutions
Highlighted
Employee

## Re: Limit the total amount of expression

Good correction

A better solution

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

9 Replies
Highlighted
Employee

## Re: Limit the total amount of expression

Please find attached one possible solution

Highlighted
MVP

## Re: Limit the total amount of expression

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

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

Highlighted
Employee

## Re: Limit the total amount of expression

Good correction

A better solution

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

Highlighted
MVP

## Re: Limit the total amount of expression

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

Highlighted
Contributor III

## Re: Limit the total amount of expression

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.

Highlighted
Contributor III

Corrigir Sunny T

Highlighted
Contributor III

## Re: Limit the total amount of expression

This solution is best.

Highlighted
Employee

## Re: Limit the total amount of expression

We need to set a maximum, for example 100.

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

Highlighted
Contributor III

## Re: Limit the total amount of expression

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

Thank you so much.