
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set Analysis: Equal to Value1 but Not Equal to Value2 for a Field
Hello,
I need to make a COUNT in a field ACCOUNT_ID for those ACCOUNT_IDs that have a SEQUENCE_ID = 2 but SEQUENCE_ID <> 1
Do you know how could I do that in Set Analysis?
Thank you!
- Tags:
- new_to_qlikview


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi mart,
try making your way through the help_file rgd. set_analysis.
You can build a "search expression" inside a set_expression just like you would do in a "normal" expression for a chart, meaning you can use concatenation (the &), sth. like
>>> [field] = {$( =" '<>' & [value_1]")}, [field] = {"[value_2]"} <<<
There is a shorter syntax you can use in a set_expression to combine the two, but I would not necessarily recommend going for the "shorthand" - it is detrimental to the ease_of_understanding of your code for others who might have to work on it.
HTH
Best regards,
DataNibbler
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI
Try some thing like
=count({<SEQUENCE_ID={'2'},SEQUENCE_ID<>{'1"}>}ACCOUNT_ID)
or
=count({<SEQUENCE_ID={'*'}-{'1'}>}ACCOUNT_ID)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mart,
You can different options, but I suggest:
- When you want exclude a value:
Count({<Sequence_id-={1}>} Distinct Account_ID)
- When you want count a category value:
Count({<Sequence_id={2}>} Distinct Account_ID)
-JFlorian

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count({$<SEQUENCE_ID = 2>ACCOUNT_ID}) in that expression
