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: 
fashid
Specialist
Specialist

Unexpected behavior of not equal ={'*'}- in set analysis

Hi Experts,

I have two same set analysis expressions

1)    =  ((SUM({<SERVICE_LINE={'*'}-{'CEN','STG'}>}GP_TARGET)/100))

            /count({<SERVICE_LINE={'*'}-{'CEN','STG'},GP_TARGET={'*'}-{0}>}GP_TARGET_KEY)

2)  =((SUM({<SERVICE_LINE-={'CEN','STG'}>}GP_TARGET)/100))

        /count({<SERVICE_LINE-={'CEN','STG'},GP_TARGET={'*'}-{0}>}GP_TARGET_KEY)

The only difference between these two expressions is the way not equals to is used for service_line field.

I have a difference in behavior with these two expressions.

When i click on a particular service_line list box the second expression changes and gives the desired result according to the selections made but the first expression remains static and does not change .

Is this behavior correct and should i always use the ={'*'}-

Another question is if i want to compare a value to 0 i.e. GP_TARGET not equal to zero should i write the way i have written above or should i use GP_TARGER<>0

Regards,

Nadeem

12 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In your first expression you have:

SERVICE_LINE={'*'}


Which means start with "select all values" -- which effectively ignores any selections you have made in SERVICE_LINE.


-Rob

http://masterssummit.com

http://robwunderlich.com

jonathandienst
Partner - Champion III
Partner - Champion III

Rob is correct - the first expression says select all and then exclude.

The second expression is shorthand for

     $-<...>

which means take the current selection and then exclude.

Hope that clears it up.

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

Thanks jonathan you last line "which means take the current selection and then exclude." made it more clear

Regards

Nadeem