Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
anushree1
Specialist II
Specialist II

Capping in Qlikview

Hi All,

I have a requirement to cap the values >=vmin and<=vmax, so in case it is just the capping of a number greater than vmax i would use ragemax or ragemin as expected but here i need to do it both the ways.

For eg:

My dataset is as below:

  

DimVal
A10
B54
C32
D85
E12
F65

and I want to create a table with expected col like below:

   

DimValExpected
A1020
B5450
C3232
D8550
E1220
F6550

where vmin=20 and vmax=50

Could anyone please help me on the same.

Values of vmin and vmax are dynamic and shall change based on user input

Attached a sample for the reference

1 Solution

Accepted Solutions
sunny_talwar

Seems like you need this on the front end... try this

Sum(Aggr(If(Sum(Val) < vmin, vmin, If(Sum(Val) > vmax, vmax, Sum(Val))), Dim))



Capture.PNG

View solution in original post

1 Reply
sunny_talwar

Seems like you need this on the front end... try this

Sum(Aggr(If(Sum(Val) < vmin, vmin, If(Sum(Val) > vmax, vmax, Sum(Val))), Dim))



Capture.PNG