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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: 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

16 Replies
trdandamudi
Master II
Master II

May be as below:

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

Anonymous
Not applicable
Author

This looks good, however I want to include other set analysis criteria.  Here is the actual expression I am using, but it's telling me there is an error

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

ankit777
Specialist
Specialist

it would be then

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

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

Kushal_Chawda

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

Anonymous
Not applicable
Author

Replace the +[Trading Of]={"Salads"} with ,[Trading Of]={"Salads"}

sunny_talwar

Try this:

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

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