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: 
Not applicable

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!

4 Replies
datanibbler
Champion
Champion

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

sasikanth
Master
Master

HI

Try some thing like

=count({<SEQUENCE_ID={'2'},SEQUENCE_ID<>{'1"}>}ACCOUNT_ID)

or

=count({<SEQUENCE_ID={'*'}-{'1'}>}ACCOUNT_ID)

javier_florian
Creator III
Creator III

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

Anonymous
Not applicable
Author

Count({$<SEQUENCE_ID = 2>ACCOUNT_ID}) in that expression