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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ferha_jafri
Partner - Creator III
Partner - Creator III

Set inside a set

Hello Everyone,

I need help in writing an expression in which I want exclude POL1,POL3,POL4 for location 3704  in a way that I should get the remaining one. Eg total mailpiece count is 9 and exclusion is 2 so and should be 7. Attaching the sample.

Thanks in advance

Ferha Sharma

1 Solution

Accepted Solutions
tresesco
MVP
MVP

If you exclude POL1,POL3,POL4 and sum it, it actually sums for rest (selected in screenshot 1) of the Pre_Adv_Customer which is like in case 1 in screenshot that doesn't give you 7. If you fix the selection of Omc_location_id to '3704' then the sum becomes 1( screen shot 2), because only one from rest members of Pre_Adv_Customer is relevant to it (refer 2 and 3).

Untitled.png

Hope this helps.

View solution in original post

11 Replies
tresesco
MVP
MVP

Which expression are you working on?

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

=sum({<Omc_Location_Id={$(=Concat({<Pre_Adv_Customer-={$(vCustomer_Not)}>}Location_Not,','))}>}Mailpiece_Count)

I want to write an expression in a way that it give me a result of 7 as 9 -2 =7

antoniotiman
Master III
Master III

Hi Ferha,

maybe

=sum({<Location_Not={'3704'},Pre_Adv_Customer={'POL1*','POL3*','POL4*'}>} Mailpiece_Count)

Regards,

Antonio

Anil_Babu_Samineni

Where we need to look? I mean which sheet? Which object?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ferha_jafri
Partner - Creator III
Partner - Creator III
Author

sheet 2 and object table , expression is mentioned above.

tresesco
MVP
MVP

If you are only looking for output '7' then try like:

=Sum({1}Mailpiece_Count) -

Sum({<Pre_Adv_Customer-={"$(=Only({<Omc_Location_Id={3704}>}Notcus))"}>}Mailpiece_Count)

Note: The logic you are assuming to exclude the field values and get the output is not correct, because the values are not mutually exclusive against other field values.

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

yes that is correct but my condition is I want to get 7 without implementing a condition as sum(mailpiececount)-sum({<Location_Not={'3704'},Pre_Adv_Customer={'POL1*','POL3*','POL4*'}>} Mailpiece_Count) as 9-2=7 ,


I want to write  a expression as one to get the result.

antoniotiman
Master III
Master III

Can You explain why result is 7 ?

Edit : my expression is

=sum({<Location_Not={'3704'},Pre_Adv_Customer-={'POL1*','POL3*','POL4*'}>} Mailpiece_Count)

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

because I want to exclude it , so the sum of mailpiececount is 9 and the condition will give 2 so the ans is 7