Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kinjal1645
Creator
Creator

Variable value with space is used in expression

Hi All,


I have following variables:

vref1=If(GetPossibleCount(p1_ref)=1,p1_ref)

vP1val=If(GetPossibleCount(p1_value)=1,p1_value)

vref2=If(GetPossibleCount(p2_ref)=1,p2_ref)

vP2val=If(GetPossibleCount(p2_value)=1,p2_value)


output of these variables for one case:

vref1= ca_1

vP1val= not configured

vref2= ca_xa

vP2val= 2A


These variables are used in calculated dimension of straight table:

=aggr(Only({$<$(vref1)={$(vP1val)},$(vref2)={$(vP2val)}>} m_field),m_field)

But I am getting blank table for these selections because there is space in "not configured"


When I change vP1val = configured then table is populated with values.


Let me know how to handle this i.e. when there is space in variable value and used in expression.


Kindly help!


Thanks

1 Solution

Accepted Solutions
sunny_talwar

Add single quotes around your variable in set analysis

=Aggr(Only({$<$(vref1) = {'$(vP1val)'}, $(vref2) = {'$(vP2val)'}>} m_field), m_field)

View solution in original post

4 Replies
sunny_talwar

Add single quotes around your variable in set analysis

=Aggr(Only({$<$(vref1) = {'$(vP1val)'}, $(vref2) = {'$(vP2val)'}>} m_field), m_field)

kinjal1645
Creator
Creator
Author

Thanks! That was quick

kinjal1645
Creator
Creator
Author

Can you let me know what does single quotes indicate?

sunny_talwar

that you have a literal between two single quotes

Quotes in Set Analysis