Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a variable to filter a set expression

Hi,

I have a variable called vJTBD.

vJTBD can contain any order and number of the following examples:

'Conversion, Awareness'

'Conversion'

'Awareness, Engagement, Conversion'

'Awareness, Conversion, Engagement'

This variable is created dynamically on the fly. It will never be more than 4 words, and will always be one word long.

Can someone tell me how I'm supposed to integrate this into my set expression? [ attached ]

1 Solution

Accepted Solutions
swuehl
MVP
MVP

The difference between the two expressions is (when variabe is dollar sign expanded)

JTBD = { Awareness, Engagement, Conversion }

and

JTBD = { 'Awareness, Engagement, Conversion' }

right?

In general, I believe you don't need to quote each value in your field value list (though it might be necessary in special cases), but if you want to quote, you need to do it like

JTBD = { 'Awareness', 'Engagement', 'Conversion' }

(i.e. quote each value instead of the list of values). You can also use the quoted version, this just makes your expression a little more complex, and as you see, it is not necessary in your case.

View solution in original post

4 Replies
swuehl
MVP
MVP

Try removing the single quotes, just ... JTBD = {$(vJTBD)}

Not applicable
Author

This is now functionally working. (looks like my logic isn't correct though)

I have no idea why it needs to be this way but thank you.

You've answered so many of my questions on these forums I now recognise your name!

Best,

James.

swuehl
MVP
MVP

The difference between the two expressions is (when variabe is dollar sign expanded)

JTBD = { Awareness, Engagement, Conversion }

and

JTBD = { 'Awareness, Engagement, Conversion' }

right?

In general, I believe you don't need to quote each value in your field value list (though it might be necessary in special cases), but if you want to quote, you need to do it like

JTBD = { 'Awareness', 'Engagement', 'Conversion' }

(i.e. quote each value instead of the list of values). You can also use the quoted version, this just makes your expression a little more complex, and as you see, it is not necessary in your case.

Not applicable
Author

once again thanks for explaining.

have a nice day,

James.