Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bimartingo
Contributor III
Contributor III

Issues on Variables and $() expressions

Hi,

I'm using variables in expressions and i think i have found a kind of bug.

Example:

i define on script a variable called vSegmento where i define the value of the field [Segmento] that i'll use on the set expression (for a graph)

Sum({<[Segmento] = {$(vSegmento)}>} Measure_to_sum)

Everything works fine when i use

LET vSegmento = 'Segm_1'

but when i change it to

LET vSegmento = 'Segm 1'

(note the "space" character) there is no data on Graph.

Sure, i have the values 'Segm_1' and 'Segm 1' as part of the field Segmento.on data

Is this a bug or i'm doing something wrong?

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Giving Single quotes fixes the issue.  Because of the space between the words is causing the issue.  It is a good practice to always give quotes in expression.

=Sum({<[Segmento] = {'$(vSegmento)'}>} Measure_to_sum)

Regards,

Jagan.

View solution in original post

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     use $(vSegmento) within single quotes..

  

     Sum({<[Segmento] = {'$(vSegmento)'}>} Measure_to_sum)

Hope it helps

Celambarasan

jagan
Luminary Alumni
Luminary Alumni

Hi,

Giving Single quotes fixes the issue.  Because of the space between the words is causing the issue.  It is a good practice to always give quotes in expression.

=Sum({<[Segmento] = {'$(vSegmento)'}>} Measure_to_sum)

Regards,

Jagan.