Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis - OR

Hi

I have value field called 'Sales' and two category fields, for example 'CategoryA' and 'CategoryB'.

I want to include the expression sum(Sales) but only where CategoryA OR CategoryB equal "ProductA"

What would the set analysis be?

Thanks

A

1 Solution

Accepted Solutions
ankit777
Specialist
Specialist

Try this

sum({<[XL Date]={"<=$(vLatestReturnsDate)"},[Ledger Type]={"Actual"},[Commission Of]={"Salads"}>+

<[XL Date]={"<=$(vLatestReturnsDate)"},[Ledger Type]={"Actual"},[Trading Of]={"Salads"}>}[Hds/Kg KPI])

View solution in original post

16 Replies
sunny_talwar

Try this:

Sum({<Category = {'CategoryA', 'CategoryB'}>}Sales)

ankit777
Specialist
Specialist

Hi

try like this

if (CategoryA ='ProductA' or CategoryB='ProductA', sum(Sales))

Chanty4u
MVP
MVP

Try this

=sum({<Catageory={'CategoryA ',' CategoryB'}>}sales)

Anonymous
Not applicable
Author

The fields are CategoryA and CategoryB and I want to include when the value in either CategoryA or CategoryB is ProductA

Anonymous
Not applicable
Author

Hi

I'd rather not use if statements

sunny_talwar

May be this:

Sum({<CategoryA = {'ProductA'}> + <CategoryB = {'ProductA'}>}Sales)

Chanty4u
MVP
MVP

try

sum({<CategoryA='ProductA' or CategoryB='ProdcutA' >}sales)

Anonymous
Not applicable
Author

Try

Sum({<CategoryA = {'ProductA'}>}Sales)+Sum({<CategoryB = {'ProductA'}>}Sales)

Anonymous
Not applicable
Author

Sum({<CategoryA ={'Product A'} > +  <CategoryB={'Product A'}>}Sales)