Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Remco
Contributor III
Contributor III

Combining a variable with a text character and use the combination as filter in set analysis

Hello all, another question:

I have this a measure and it works fine:

Sum({<FORECASTID = {"412"},OUTPUT_VAL={"*436*"}>} Value_)

But for the numbers I need to use variables, vForecastA and vForecastB

How can I make it in such a way that there is a kind of concat that combines the " with the value of the variables? The variables are plain numbers and cannot contain characters.

I tried to concat like concat('"',vForecastA,'"') but that does not work. For the part with the * the issue is the same, just have to add the asterisks to the string part.

The aim is that I want to filter FORECASTID on the variable vForecast and OUTPUT_VAL needs wildmatch filter on vForecastB

 

Thanks for your ideas!

Labels (3)
1 Solution

Accepted Solutions
SerhanKaraer
Creator III
Creator III

Hello Remco,

try this:

Sum({<FORECASTID = {$(=concat(DISTINCT chr(34)&'$(vForecastA)'&chr(34),','))},OUTPUT_VAL={$(=concat(DISTINCT chr(34)&'*$(vForecastB)*'&chr(34),','))}>} Value_)

In this scenario,  vForecastA and vForecastB vairables must be a field reference, not a string.

View solution in original post

3 Replies
SerhanKaraer
Creator III
Creator III

Hello Remco,

try this:

Sum({<FORECASTID = {$(=concat(DISTINCT chr(34)&'$(vForecastA)'&chr(34),','))},OUTPUT_VAL={$(=concat(DISTINCT chr(34)&'*$(vForecastB)*'&chr(34),','))}>} Value_)

In this scenario,  vForecastA and vForecastB vairables must be a field reference, not a string.

Remco
Contributor III
Contributor III
Author

Wow, that was quick. And it works 🙂

 

Thanks a lot!

SerhanKaraer
Creator III
Creator III

@Remco I added DISTINCT in concat for performance issues in the original post.