Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable with Concat into Set Analysis

Hi

I've a variable called vTest = Concat(DISTINCT {$<FlagCY={1},M.FECHA={">=$(#desde)<=$(#hasta)"},M.NIVEL1 ={'01'},M.RESPUESTA ={'Si'},M.MARCA = p(MARCALEVADURA_T)>} ID_SITIO,',')

This vTest output is 15073,15074

I've just created another var called vTest2 = '15073,15074'

Then i've a chart witt the followings expresion :

sum({$<ID_SITIO = {'$(=$(vTest))'},M.MARCA = p(MARCALEVADURA2_T)>} CANTIDADLEVADURA)

sum({$<ID_SITIO = {'$(=$(vTest2))'},M.MARCA = p(MARCALEVADURA2_T)>} CANTIDADLEVADURA)

An its  not working with neither both options

If ihardcode this :

sum({$<ID_SITIO = {'15073,15074'},M.MARCA = p(MARCALEVADURA2_T)>} CANTIDADLEVADURA)

Works fine.

Any idea?

Thanks

Albert

1 Solution

Accepted Solutions
Not applicable
Author

Problem Solved.

The problem was that concat was returning the list of values, without quotes in the numbers

i've use : ' "," ' as concat separator, in order to have the list of values separated by commas and surronded with quotes.

Thanks to all.

Albert

View solution in original post

8 Replies
Not applicable
Author

Sorry,

The hardcoded expresion should be

sum({$<ID_SITIO = {15073,15074},M.MARCA = p(MARCALEVADURA2_T)>} CANTIDADLEVADURA)

WITHOUT SIMPLE QUOTES

Thanks    

Anonymous
Not applicable
Author

It happens sometime and annoying to find out the real reason. Most of the time problems lie with quotes, Dollar sign, or equal to sign. Could you please try once removing = sign from the variables where you created that. If it is there then try by removing it. It's not a solution just some random trial. If u share with your app, I could try help you more efficiently.

Anonymous
Not applicable
Author

Try to use double quotes here:

= {"$(=$(vTest))"}

Anonymous
Not applicable
Author

Hmm, from the description it is not clear if there is '=' sign in the variable definition.  Very possible it maybe a reason.

Not applicable
Author

The varible is defined without the equalbefore Concat

Not applicable
Author

when vTest returns just one element, the expresion is working fine, if returns more than one, fails.

Anonymous
Not applicable
Author

It helps.  See if the hardcoded this way works (each value in single quotes)

{'15073','15074'}

If it works, modify your variable to enclose each value in the single quotes.  Again, I recommend to use double quotes as in my earlier post.


Not applicable
Author

Problem Solved.

The problem was that concat was returning the list of values, without quotes in the numbers

i've use : ' "," ' as concat separator, in order to have the list of values separated by commas and surronded with quotes.

Thanks to all.

Albert