Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

where clause in expressions

Hi Experts,

I have a requirement in my project where an user enters the min and max limit of a column(through input box).

I am saving these in variables ...var1 & var2.

I need to show the value of Avg(column1) where value of column1 > $(var1) and < $(var2) in a textbox.

I am not able to create this successfully.

Any help would be much appreciated.

Thanks in advance.

1 Reply
rubenmarin

Hi Nayana, supossing you have a table with a dimension 'Dim' and value 'Data' you can use this expression in table:

If(Sum(Data)>=$(var1) and Sum(Data)<=$(var2), Sum(Data))

For the average check the total type as 'average'

In a text box you can show the Avg() with this expression:

=Avg(Aggr(If(Sum(Data)>=$(var1) and Sum(Data)<=$(var2), Sum(Data)), Dim))