Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning Community,
I've got a challenge where I'm trying to clear a variable to Null.
I can do this in the load script, but then once the variable is input via the calendar, it isn't possible to then set as Null. I have tried the action to set variable to blank or to null, but it doesn't work.
I can set the variable to a value within the data set, i.e another date but cannot clear it or set it to null. Any ideas?
With thanks,
Simon
Hello, Simon
I think, You've got a solution already.
But if not You could look at the nice solution.
Re: How to make the default clear all button clear variables; without using macros
Selecting the only possible value in the listbox You clear the variable.
(You can go to Document setting and see Field Event Trigger)
Take a look here: QlikTip #9: Deleting variables via user-interface, within the load-script or by using macros (transl....
- Marcus
Thank You, Marcus
Could You give an advise, please.
Is there a way to Clear all Variables of an app in front-end of Qlik Sense?
I think not really ... Re: How to delete all my variables within an app
- Marcus
Thanks, Marcus
Hi Simon
You could write a simple script ex: on a button click action like as follows. The script below clears any user defined variables(assuming that they start either with a 'e' or a 'v'.
Sub ClearVarValues
set vars = ActiveDocument.GetVariableDescriptions
for i = 0 to vars.Count - 1
set v = vars.Item(i)
set vdef = ActiveDocument.Variables(v.Name)
StartLetter=left(v.Name,1)
if StartLetter="v" or StartLetter="e" then
vdef.SetContent "",true
'Msgbox(v.Name&" "&vdef.GetRawContent)
End If
next
set vars=nothing
End sub
hth
Sasi