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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Handling null variable values

Hi,

Im working with with several inputboxes, and each of one has a variable assigned to it. These inputboxes are made to insert numerical values but when the user delete the value in it I need to write a 0 value instead.   I have tried to use the functions inNull(myVariable) or myVariable=null() to use some trigger but any of these work. If the variable is empty I can not make any thing with it (for example if I need the variable in some if expression, its not working).

Any ideas about how can I handle these "empty" variables?

Thanks!

4 Replies
Not applicable
Author

Could you not  use in your expression smething like if(MyVariable = '' ...   to handle the empty case ?

ariel_klien
Specialist
Specialist

Hi

You can use if ()

something like that:

if($(myVariable)=null(),0,$(myVariable))

BR

Ariel

nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

Try this expression,

If (len(myVariable)=0,0,myVariable)

Regards,

Nirav Bhimani

Not applicable
Author

Wow! Thank you very much for the quick answers!

In fact these expressions are the ones I have been using all the morning without success.

I have just tried this in the trigger, and it´s finally working!!

 

=if('$(vVar)'='', 0, $(vVar))

Thank you very much