Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
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

Tags (1)
3 Replies
israrkhan
Valued Contributor II

Re: Where clause in expression

hi Luke

try below expression

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

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

Hope it helps

MVP & Luminary
MVP & Luminary

Re: Where clause in expression

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
Partner
Partner

Re: Where clause in expression

Hi!

Try this:

ceil

(

     Sum

     (

          {<Product = {'ABC'}>}

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

     )

,.001

)