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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
zekazak
Creator
Creator

Exclude Group in Set Analysis

Hello,
How can I exclude all the rows of any particular order from the table if at least one of the rows of particular order has Item Type NOT "a".
DateOrderItemType
01/01/20131a
01/01/20131b
01/01/20131c
01/01/20132c
01/01/20132d
01/01/20133a
01/01/20134
a
01/01/20134a
From the table above I expect to see the result like this:
DateOrderItemType
01/01/20133a
01/01/20134a
What would be a set analysis formula? Any help would be much appriciated.
Thanks in advance!
~Serg
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: MaxString({<Order=e({<ItemType-={'a'}>}Order)>*<Order={$(=concat(distinct Order,','))}>} ItemType)


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

Try this one to your script.

LOAD

Distinct
Date,Order,ItenType

Resident TableName Where Order<>'1' and ItenType='a';

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try as expression MaxString({<Order=e({<ItemType-={'a'}>}Order)>} ItemType). See attached example.


talk is cheap, supply exceeds demand
jagan
Partner - Champion III
Partner - Champion III

Hi,

Please find attached file hope it helps you.

Regards,

Jagan.

Not applicable

There are many ways, this is the easiest for me

Add the field in as a dimension with an if statement

i.e. if(ItemType<>'a',ItemType,)

Then tick the tickbox for suppress nulls for this dimension.

All values that aren't 'a' will not appear on your report.

For set analysis you can use this MaxString({$<ItemType-={'a'}>}ItemType). The '-' before the equals sign will exclude all ItemType's that aren't a. However this - is not recognised function and so your expression will look like you have entered incorrect syntax but the expression will read ok

Cheers,

Byron

zekazak
Creator
Creator
Author

Hello all,

Thank you all for the very quick responces. It helped a lot. And I've got it done now.

Gysbert's answer is the one I've been looking for.

Best Regards,

~Sergejs

zekazak
Creator
Creator
Author

Hi Gysbert,

I have another quick question regarding to your set analysis expression.

The thing is that if I select Order 3 for example in your application it displays 4 rows instead of 1.

1.png

How should I amend the formula to tak into account the other selections? Thank you in advance.

~Sergejs

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: MaxString({<Order=e({<ItemType-={'a'}>}Order)>*<Order={$(=concat(distinct Order,','))}>} ItemType)


talk is cheap, supply exceeds demand
zekazak
Creator
Creator
Author

Hi,

Awesome.It works. Thanks.

Best Regards,

~Sergejs