Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
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.

1 Solution

Accepted Solutions
Highlighted

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])

View solution in original post

3 Replies
Highlighted

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])

View solution in original post

Highlighted
MVP
MVP

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

Highlighted
Contributor III
Contributor III

That simple!

Thank you, couldn't find this anywhere.