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

Help on Set analysis


Hello,

I want to get the result using 3 sets

count( {<expr1> + $<expr2> - <expr3>}id)

How is this evaluated ?

I am looking for the values from  (<expr1> + $<expr2> )  excluded with (<expr3>)

Kindly help me to understand.

Thanks,

Deepa V

7 Replies
alexandros17
Partner - Champion III
Partner - Champion III

count( {$ <year={2010,1011}-{2000}>}id)


this is an example but to help you add more detai

senpradip007
Specialist III
Specialist III

Can you share your expression?

Not applicable
Author

Hi,

Below is the expression.

count({ $*<BREAKAGE_DESCRIPTION = {"*"}> + <BREAKAGE_DESCRIPTION = {""}> - <flagDate = {""}>}    Id))

Thanks,

Deepa V

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Are you trying to find nulls in BREAKAGE_DESCRIPTION and/or flagDate? If that is the case, then you cannot use a set expression. You will need something like this:

Count(If(Len(BREAKAGE_DESCRIPTION) > 0 Or (Len(BREAKAGE_DESCRIPTION) = 0 And Len(flagDate) > 0), Id))

which will simplify to this:

Count(If(Len(BREAKAGE_DESCRIPTION) > 0 Or Len(flagDate) > 0, Id))

If the Count(if()) performs badly, then you can create a null flag during the LOAD and use that in a set expression. Or you could use NULLASVALUE on the two fields to convert nulls to empty strings.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

If the set expression is searching/excluding for empty strings, then this might be what you need:

Count({<BREAKAGE_DESCRIPTION -= {""}> + <BREAKAGE_DESCRIPTION = {""}, <flagDate -= {""}>} Id))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author


Hi,

There is a list box with BREAKAGE_DESCRIPTION

When some value is selected , then i need count on selected BREAKAGE_DESCRIPTION and also count of BREAKAGE_DESCRIPTION with nulls

With the above result

I want to eliminate the data with Flagdate NULL

Kindly suggest.

Thanks,

Deepa

jonathandienst
Partner - Champion III
Partner - Champion III

Count(If(Len(BREAKAGE_DESCRIPTION) > 0 Or Len(flagDate) > 0, Id))

(eliminate null flagDate if BREAKAGE_DESCRIPTION is also null)


Count(If(Len(BREAKAGE_DESCRIPTION) > 0 And Len(flagDate) > 0, Id))

(eliminate anything that has a null in either field)


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein