Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
hugmarcel
Specialist
Specialist

Set Analysis with OR in P function

Hi

I want to calculate the sum of sales for all compaigns (main dimension) which are part

of either the sales-b campaigns or the sales-c campaigns (sub dimensions).

How can it be done? Something like

SUM({<CAMPAIGN=P([SALES_B CAMPAIGN]) OR CAMPAIGN=P([SALES_C CAMPAIGN])<} SALES)

does not work.

Thank you!

Marcel

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like:

SUM({<CAMPAIGN=P([SALES_B CAMPAIGN])> + < CAMPAIGN=P([SALES_C CAMPAIGN])>} SALES)

View solution in original post

3 Replies
tresesco
MVP
MVP

May be like:

SUM({<CAMPAIGN=P([SALES_B CAMPAIGN])> + < CAMPAIGN=P([SALES_C CAMPAIGN])>} SALES)

hugmarcel
Specialist
Specialist
Author

Thank you, that's fine!

What is the correct formula if I want to have all campaigns which are

in ( [SALES_B CAMPAIGN] OR [SALES_C CAMPAIGN] ) but NOT in [SALES_D CAMPAIGN]

Thank you! Marcel

tresesco
MVP
MVP

This?

SUM({<CAMPAIGN=P([SALES_B CAMPAIGN])> + < CAMPAIGN=P([SALES_C CAMPAIGN])> - < CAMPAIGN=P([SALES_D CAMPAIGN])>} SALES)