Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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

1 Solution

Accepted Solutions
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

View solution in original post

12 Replies
antoniotiman
Master III
Master III

Hi Nadeem,

the first expression is wrong

Service_Line={<{*}>-<{'CEN','STG'}>}

the 2nd is correct.

GP_TARGER <> 0 --> GP_Targer-={0}

Regards,

Antonio

fashid
Specialist
Specialist
Author

Hi Antonio ,

Thanks for replying

The first expression is correct in terms of the result it returned before any selections were made but if any selections are made on the service_line list box then it remains static and does not change.

And i have also read somewhere on the community that ={'*'}- can be used for not equal to comparisons as it does not give any syntax errors .

Regards

Nadeem

antoniotiman
Master III
Master III

Hi Nadeem,

the first expression is wrong. See correct sintax in above answer.

Yes You can use ={*}- but with correct sintax. See above.

Regards,

Antonio

fashid
Specialist
Specialist
Author

Ok i changed my expression to this

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

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

but i get error in expression.

Regards,

Nadeem

fashid
Specialist
Specialist
Author

Hi Can anybody please put some light on this .......

tamilarasu
Champion
Champion

Hi,

Try this.

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

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


Let me know, if this works for you.

scriptina.regular.png

fashid
Specialist
Specialist
Author

Hi tamil , My question is different please read my question above.

tamilarasu
Champion
Champion

Hi Nadeem,

I am also new to Qlikview and I misunderstood the question by just read your reply to Antonio. Sorry,I don't know the answer .  Hope someone will answer your question.

happy-day-smiley-emoticon.gif

fashid
Specialist
Specialist
Author

No problem but thanks for replying