Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

problem with operators as text in set analysis

Hi all,

I have a vairable that has dual values stored in it:

e.g.  Var1 = dual('>3 months', 3)

I am trying to write some set analysis:

=count(  {< Var1 = {'>3 months', '3-6 months'} >}  contacts)

In this scenario, it recognises the '3-6 months' but not the first one - I believe it is because of the > symbol in the text confusing QView.  How do I get around this in the expression layer without altering the names of my groups?

Thanks!

GPC

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think you may have meant Field, not Variable?  If it is a field, add a wildcard before the < as a workaround.

=count({<Var1={'*❤️ months','3-6 months'}>} contacts)

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

1. You can't use variables that return values on the left side of the = operator in set analysis expressions, only field names or expressions that return a field name.

2. The syntax isn't correct. It's generally something like count( {<FieldName = {'Value'} >} contacts)

Please read these two documents and post an example document:


talk is cheap, supply exceeds demand
Not applicable
Author

Sorry I think you may have misinterpreted my question.

Var1 has the following options : new, 1-3 months, >3 months based on an IF statement during the load script.

I set them up as a dual() value so that they easily sort.

So in reality, >3 months is stored as   dual('>3 months', 3).

And sorry, I missed a { in my example code, my set statement is:

=count(  {< Var1 = {'>3 months', '3-6 months'} >}  contacts)

I have uploaded an example - note the 3 text boxes are an attempt to replicate the table - the set with > in it never works because QView gets confused and treats it as an operator even though it's not in ""'s.  The red box is the problem one - it should make more sense now

thanks for your help!

GPC

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think you may have meant Field, not Variable?  If it is a field, add a wildcard before the < as a workaround.

=count({<Var1={'*❤️ months','3-6 months'}>} contacts)

-Rob

http://masterssummit.com

http://robwunderlich.com

Not applicable
Author

Thanks Rob - exactly what I was after!