Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with variable in set analysis

I am trying to evaluate one of two expressions, but neither works:

=Sum({1<cod_annomes ={$(#indicador1)}>}  valor) [variable indicador1 = annomes&'AT-1a', and works perfectly)

OR

=Sum({1<cod_annomes =annomes & {'AT-1a'}>}  valor)

But if it works...


=Sum({1<cod_annomes ={'201409AT-1a'}>}  valor)


Is it an error syntax? Can i use a varible in an expression with set analysis?

Thanks in advanced, i tried all that i know and read a lot of questions of this forum...


Greetings

1 Solution

Accepted Solutions
PrashantSangle

Hi,

You have Syntax Error

When you write set analysis the value you are comparing always enclosed in {     }

Like in above expression

Sum({1<cod_annomes ={"annomes & {'AT-1a'}"}>} valor)

similarly when you are using Variable you have use =

Like in above expression

Sum({1<cod_annomes ={"$(=indicador1)"}>}  valor)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

5 Replies
PrashantSangle

Hi,

You have Syntax Error

When you write set analysis the value you are comparing always enclosed in {     }

Like in above expression

Sum({1<cod_annomes ={"annomes & {'AT-1a'}"}>} valor)

similarly when you are using Variable you have use =

Like in above expression

Sum({1<cod_annomes ={"$(=indicador1)"}>}  valor)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
vardhancse
Specialist III
Specialist III

Yes we can use variable in expression with set analysis

=Sum({1<cod_annomes ={'$(#indicador1)'}>}  valor) [variable indicador1 = annomes&'AT-1a', and works perfectly)


for text we need to add ' '

Not applicable
Author

Thanks for your quick and interest Max,


The second expression that you gave me works perfectly, but not the one:

Sum({1<cod_annomes ={"annomes & {'AT-1a'}"}>} valor)


annomes is a field selectable and AT-1a a literal.

Its curious because in variable indicador1 i only do a concatenation like   annomes&'AT-1a'


Do you know what can be happening?


Thanks for your help.

Not applicable
Author

Thanks a lot Sasi,

I am trying to do concatenating annomes&'AT-1a' in the expression, but i fail....

Is any documentation about syntax in Qlikview?

PrashantSangle

Hi,

Basically issue is comming because of special character like {} and '

You have to use chr(39) for '

chr(123) for {

chr(125) for }

Try it in your searching string

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂