Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guy!,
I am new to qlikview, I want to initialize the variable with the output of the Load * statement. The result of the load * statement is completely Json object. So I want to pass this variable into java script function I create. So Is there any way? Thanks.
let yourvariable = peek('[',0,'Temp);
Or something along those lines
Hi,
Try this:
Table1:
Load *,
Field // this should have a single value
from table;
LET Variable= peek('Field',0,'Table1'); // this will store the value from column 'Field' in 'Variable'
DROP Table Table1; //optional
Even I load into a Variable like this, I still cannot pass into my javascript function.
Function Cov(JsonData)
{
...
}
When I call in Script
LOAD
Cov($(Variable))<<<<< in this line it convert Variable into the Data I set (eg. Cov({"name":"A"...)). Then this line make me error.
Thanks Guys, I am finding another way...
1- You've basically just copied my answer
2- you can clearly see the table and column names in the provided screenshot
What I mean is, the Compiler convert my Variable into the Data I set in runtime. Then it became syntax error.
you can try in Script Editor like this,
LOAD
JavascriptFunction({"name":"A", "Value":1})
....
It will give u syntax error.
Thanks for ur reply bro.
You need to load it as string so that it looked like:
LOAD
'JavascriptFunction({"name":"A", "Value":1})' as Field
...
and if you load it from a file it should go in this direction:
Load concat(@1:n, chr(10), recno()) as Field from Source (txt, no labels);
and after that you could transfer it into variable in the way Adam suggested.
- Marcus
Thanks Bro, I will try it