Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
markramiro
Contributor II

Select in Field - inserting a function

Hi Experts,

I'd like to only select rows (via a button) that satisfy a function. I first have a variable (vTestVariable) in a slider object for the user to select anywhere from 0-100. Upon clicking the button, it should only select ID's where the function below is satisfied:

Value where Type=A minus Value where Type=B should be >= vTestVariable

The table of data I am working with resembles below:

IDValueType
ABC10060A
ABC10010B
DEF99990A
DEF99980B

So if vTestVariable = 30 and the button is pressed, only ID=ABC100 should in the selection because 60-10>=30. DEF999 should not be part of selection because 90-80 < 30. Any ideas how I can implement this? I was trying to use "Select in Field" Action but finding it tricky what field to put and what search string is.

Thanks!

1 Solution

Accepted Solutions

Re: Select in Field - inserting a function

Try this as search string

='=Sum({<Type = {"A"}, ID>} Value) - Sum({<Type = {"B"}, ID>} Value) >= vTestVariable'

View solution in original post

1 Reply

Re: Select in Field - inserting a function

Try this as search string

='=Sum({<Type = {"A"}, ID>} Value) - Sum({<Type = {"B"}, ID>} Value) >= vTestVariable'

View solution in original post