Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

'-' is passing instead of ''(no value) in UI

Hi Team,

I had a Set Variable action on the text box,

=if(getselectedcount(x)=1, x,'')

but that variable Is storing '-' instead of ''.

Could some one tell how to achieve this.

Thanks,

Pranathi.

1 Solution

Accepted Solutions
Anil_Babu_Samineni

I  am  not sure I understand your issue

Replace(if(getselectedcount(x)=1, x,''),'-',' ')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

8 Replies
Anonymous
Not applicable
Author

=if(getselectedcount(x)=1, x,'')

if x is not selected '' will be evaluated as null so its showing '-'

try

=if(getselectedcount(x)=1, x,' ')

there is a space ' ' between the quotes for it to show no text.

Anonymous
Not applicable
Author

Even I keep ' ', (space), im getting, '-'

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Probably means that there is sometihng wrong with your expression.

What do you get if you put this expression in your text box?

='x sel.cnt = ' & getselectedcount(x) & chr(10) &

'Result = ' & if(getselectedcount(x)=1, x, ' ')

giakoum
Partner - Master II
Partner - Master II

The syntax is correct, so there must be something wrong with your logic. Can you post an sample file?

Anil_Babu_Samineni

I  am  not sure I understand your issue

Replace(if(getselectedcount(x)=1, x,''),'-',' ')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

the value that is in the variable should pass to another text box

Anonymous
Not applicable
Author

I got it, Thanks All

Anil_Babu_Samineni

Good to hear,  try to post that expression and flag correct answer is your response  so that fresh users can uncertain useful

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful