Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i created a variable called 'vDataInput' and i configurated it in a variable input
Now i would like to load using the variable input.
I suppose that the script is load * from table where date(DATA_INIZIO_VALIDITA,'DD/MM/YYYY') = date('$(vDataInput)','DD/MM/YYYY') but it doesn't works.
Please help me
Thanks Mauro
Do you have any error message, or the data is not returning as expected?
As mentioned above, are you receiving any errors? I'd suggest adding a trace statement in your script to check the value inside vDataInput.
Trace vDataInput: $(vDataInput);
you might also need to use the Date# function take the text string to a numerical date. you can check by adding another variable in the script:
let vDataInput2= Date($(vDataInput), 'YYYY-MM-DD');
Trace vDataInput2: $(vDataInput2);
That'll let you if you need to convert the text to dates.
HI @mauvasco62 ,
In my opinion you will not get consistent results. I presume you are using Qlik Sense. The variable input is a "session object" and value held in it can be different for each and every user depending on what they choose. When reloading app variable value will not be picked up from your session, instead default value of variable will be used (if you have set any). Now I noticed that this works different if you use Qlik Sense desktop, it works different when you reload from your work stream and also works different if you reload from published stream. In a nutshell it may as well be dependant on the ownership of the app, but I am not sure about it and i have not found whitepaper explaining how this will work.
If there was consisten solution for this you could think about creating sort of write back solution which frankly i was never able to succesfully implement using such approach.
Now here I would ask someone who knows more about this staff for opinion - @marcus_sommer @hic
Using a variable in the script works fine. I just tested it.
However, there are some limitations...
Just as Lech points out, variables are instantiated in a multi-user system: The document variables are copied so that each user has its own copy. So you cannot expect it to work in a managed space. But in a private space it works.
Secondly, the script execution starts by flushing the entire data model, so that a new one can be built. This means that a dynamic variable definition (starting with an equals sign) will NOT work: Calculations cannot be made. But a static definition will work.
HIC
Hello everyone,
thanks your feedback.
By adding a second control variable, the upload script is now working.
I still don't know if my colleagues will be able to upload the data correctly when the app is published.
Have a nice day
Mauro