Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where clause in expression

Hi,

I have the following expression in a table that returns values based on the entire data set.  What is the correct method to limit the data to particular areas?

Original Expression:

=ceil([Refund Count]/([Closed Call]+[Closed Email])

,.001)

I need to be able to add a where clause to this expression to limit values and the calculation to look at a particular product of 'ABC'

How can this be accomplished?

Thanks

3 Replies
israrkhan
Specialist II
Specialist II

hi Luke

try below expression

=ceil({<Product = {'ABC'} >} [Refund Count]/([Closed Call]+[Closed Email]),.001)

Product ={'ABC'} is your where clause.

Hope it helps

Gysbert_Wassenaar

It's not clear if Refund Count, Closed Call and Closed Email are field names or column labels. If they are field names you can use something like:

=ceil(only({<Product={'ABC'}>}[Refund Count])/(only({<Product={'ABC'}>}[Closed Call])+only({<Product={'ABC'}>}[Closed Email])),.001)

Replace Product with the name of your product field.

If you used column labels of expressions in your expression that you'll have to add the set modifier {<Product={'ABC'}>} to the aggregation functions in those expressions.


talk is cheap, supply exceeds demand
felipe_dutra
Partner - Creator
Partner - Creator

Hi!

Try this:

ceil

(

     Sum

     (

          {<Product = {'ABC'}>}

          [Refund Count]/([Closed Call]+[Closed Email])

     )

,.001

)