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: 
Not applicable

Capping by Group

Hi All,

I'm trying to create a load script that will create column E.

Essentially I'm trying to cap my transaction by column A, column B represents transaction sorted by time.

Thank you for your help.

BCappngPost.jpg

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

Gysbert,

Can you please share brief description steps, about the solution you posted.

Thanks,

Angad

Not applicable
Author

Thank you very much for your help.

Not applicable
Author

The only thing it doesn't do is Cap the first transaction row if it is above the cap.

Example, if the row1 column c had a value of 350. The code sows 350, it should show 250.

Not applicable
Author

Made the small change to get the capping on the first row. Thank you again for your help.

if(previous(P)=P, if(previous(CumTrans) < $(vCap), rangemin(Transaction,$(vCap)-previous(CumTrans)),0),If(Transaction > $(vCap),$(vCap),Transaction)) as Cappd2