Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a variable in my qvw file. Now i want to display this variable in table.
- If is possible to store this variable in text file along with data.
Hi,
Anytime you want to store anything in a file, you need to previously load it, unless you want to use some unnecessary (in my point of view) macro code.
VariableTable:
LOAD $(vVariable) AS Variable
AUTOGENERATE 1;
STORE VariableTable INTO File.txt (txt);
Hope that helps.
BI Consultant
Hi,
Anytime you want to store anything in a file, you need to previously load it, unless you want to use some unnecessary (in my point of view) macro code.
VariableTable:
LOAD $(vVariable) AS Variable
AUTOGENERATE 1;
STORE VariableTable INTO File.txt (txt);
Hope that helps.
BI Consultant
Hi,
You can display variable in Straight Table. Just place "=Varibale_Name" in Expression if it contains value. If it is an expression then use "=$(Variable_Name).
For second Question - Yes you can store varibales in text file and then use them in Qlikview.
Regards,
Kaushik Solanki
Miguel,
what you said correct but the think is when i'm using this text file in another qvw file using include statement (i.e., $(Include=d:\examples\file.txt);). Shows the error message while loading qvw file.
Hi,
Its because you have not declared the variable properly in text file.
Make sure your text file have variable declaration like below.
Set vVariable1 = 'ABC';
Set vVariable2 = 'PQR';
............... And so on,
Hope this will help you.
Regards,
Kaushik Solanki
Kaushik,
I created the vVariable globally and now i'm using this variable in edit script. The think is i want to store this variable in text file and i want to use the data of particular variable.
As per miguel give code its creating a variable along with data in the text file. How to set variable property in text file as per code given my miguel.
Hi,
Can you please explain what are you trying to achieve, this will help us to understand your problem in detail.
Regards,
Kaushik Solanki
Hi,
Are you using "File.txt" (the file where you previously stored the table with the variable) as the include file? In that case, you will need to LOAD the file instead of use it in the include, since it's not properly formatted to be used as a piece of script code.
In other words, you cannot save a txt file with a variable as a field (as in my example above) and then use it in the include variable. The include variable inserts the text in the file specified in the script, and so this text must be a valid script code.
Here's my guess on what you want to get
// Load variable saved in previous STORE statement or in a different document
Variable:
LOAD Variable
FROM
C:\File.txt
(txt, utf8, embedded labels, delimiter is '\t', msq);
LET vDestinationVariable = FieldValue('Variable', 1);
DROP TABLE Variable; // Cleanup
Now, in the second file, vDestinationVariable has the same value it has in the file you have stored it.
Hope that helps.
BI Consultant
Thanks a lot miguel I need some more help from you.
- If the variable contains the data in string format i mean i.e., vVariable=A or vVariable=A,B,C,D
It showing an error.
What i'm trying to achive is i had taken a list box and based on my selections i'm storing particular selections into variable.
I'll attach my file for your reference to understand what i'm doing.
Hi,
All you have to do is place $(Variable) in single quote ie.
load
'$(Variable)' as Variable
............
Go through the attahcment.
Hope this will help you
Regards,
Kaushik Solanki