Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
joantbak
New Contributor III

Expression using OR

Seems a simple question but can't find a discussion on it anywhere...How do I use OR in an expression.

I want to Express;

Sum({<

( [Site]={"Site1"},[Date]={"02/01/2017"},[Hour]={"13"} )

OR

( [Site]={"Site2"},[Date]={"01/01/2017"},[Hour]={"14"} )

OR

( [Site]={"Site3"},[Date]={"07/01/2017"},[Hour]={"16"} )

>} [Gross Sales])

This should produce;

SiteDateHourGross Sales
Site102/01/201713£100,000
Site201/01/201714£98,025
Site307/01/201716£90,245

The Idea being that these are the top 3 results from another expression and I want only see results relating to them in combination only.

Many thanks for any help.

Tags (3)
1 Solution

Accepted Solutions

Re: Expression using OR

May be this:

Sum({<[Site] = {"Site1"}, [Date] = {"02/01/2017"}, [Hour] = {"13"}>+<[Site] = {"Site2"}, [Date] = {"01/01/2017"}, [Hour] = {"14"}>+<[Site] = {"Site3"}, [Date] = {"07/01/2017"}, [Hour] = {"16"}>} [Gross Sales])

3 Replies

Re: Expression using OR

May be this:

Sum({<[Site] = {"Site1"}, [Date] = {"02/01/2017"}, [Hour] = {"13"}>+<[Site] = {"Site2"}, [Date] = {"01/01/2017"}, [Hour] = {"14"}>+<[Site] = {"Site3"}, [Date] = {"07/01/2017"}, [Hour] = {"16"}>} [Gross Sales])

MVP
MVP

Re: Expression using OR

OR is '+' in set analysis. Try like:

Sum({

<[Site]={"Site1"},[Date]={"02/01/2017"},[Hour]={"13"}>

+

<[Site]={"Site2"},[Date]={"01/01/2017"},[Hour]={"14"} >

+

<[Site]={"Site3"},[Date]={"07/01/2017"},[Hour]={"16"} >}

[Gross Sales])

Also note '< >'

joantbak
New Contributor III

Re: Expression using OR

That simple!

Thank you, couldn't find this anywhere.