Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
bimartingo
New 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?

Tags (1)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Issues on Variables and $() expressions

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.

2 Replies

Issues on Variables and $() expressions

Hi,

     use $(vSegmento) within single quotes..

  

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

Hope it helps

Celambarasan

MVP & Luminary
MVP & Luminary

Issues on Variables and $() expressions

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.