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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
samvile18
Creator III
Creator III

Dynamic Variable - Text Issues

Hello all,

I'm fairly sure this is possible I just can't quite get the syntax right. I have a variable input box and the values are dynamic...I need the them to return the following but can't get the syntax right:

'Web', 'App'~Total|Web~Web|App~App

It's the first part that's causing me the issue. I'm essentially trying to replace value in set analysis with what this variable returns but the extra single quotes are causing me no end of problems. The ideal outcome would look like this:

vResultsChannel = 'Web', 'App' or Web or App 

Does that make sense?

 

Labels (4)
1 Solution

Accepted Solutions
samvile18
Creator III
Creator III
Author

I actually managed to do it with this:

=Concat('''' & 'Web' & ''''& ', ' & '''' & 'App' & '''')

Which looks a lot dirtier than your suggestion tbh. I think I'll try and swap it for what you've stated. 

View solution in original post

5 Replies
Digvijay_Singh

Can you share sample app to understand how you are trying this, I am sure someone would help better with sample app

Daniel_Castella
Support
Support

Hi @samvile18 

 

If you are having issues for having extra single quotes, try to define them in the variable as ascii characters. Like this:

chr(39)&Web&chr(39)

or this

chr(39)&'Web'&chr(39)

 

Also, check if maybe you need double quotes in the set analysis where the variable is being set.

 

As previously replied, if you provide a sample app, we will be able to better guide you since we will better understand your expressions.

 

Kind Regards

Daniel

samvile18
Creator III
Creator III
Author

I actually managed to do it with this:

=Concat('''' & 'Web' & ''''& ', ' & '''' & 'App' & '''')

Which looks a lot dirtier than your suggestion tbh. I think I'll try and swap it for what you've stated. 

samvile18
Creator III
Creator III
Author

How do I create a sample qvf? That would help on almost everything I post here!

Rahul_123
Partner - Contributor III
Partner - Contributor III

If this is about creating a measure that works based on input provided by a Qlik user in an input box, where the value is stored or passed through a variable, and the values Web and App are present in a table column, then you can use the following two approaches:

pick(match(vVariableResult, 'Total', 'Web', 'App'), sum(sales), sum({<channel={'Web'}>} sales), sum({<channel={'App'}>} sales))

sum({<columnName={'$(vVariableResult)'}>} sales)

if it not worked give some additional information about what you want.