Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

Display variable in table

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.

17 Replies
Miguel_Angel_Baeyens

Hi,

Change your action in the Click button to the following so each of the possible text values are quoted so they can be used later:

=chr(39) & GetFieldSelections(Group,chr(39) & chr(44) & chr(39)) & chr(39)

That will store 'A','B', etc in the variable

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

kaushik / Miguel,

Thanks a lot both of you. If there is any possibility to reload "Secondary qvw file " when we are navigating from "primary qvw file" to  " Secondary qvw file ". I know how to open another qvw file on button action but i don't know how to reload second qvw file while we are navigating.

- And one more thing is when i'm keeping the positions of action for a button to reload and open another qvw file. It is not working. The positions can be seen in below image:

Capture.PNG

- If the positions are like below image it is navigating to another file..

Capture.PNG

Miguel_Angel_Baeyens

Hi,

Yes, the order of the actions is important. In your macro, you are reloading, so the application stops its macros and reloads. Once it has reloaded, it doesn't continue executing macros, because it's a different action (take a look at the Settings menu, Document Properties, Triggers, Document Event Triggers, OnOpen or OnPostReload).

You cannot reload one document from another, but following with the above, you can set a trigger so when the second document is opened (OnOpen), it reloads.

I'm assuming you are not working with server. If you are, some of these actions may not work when you open the document from a client.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Miguel,

Yes you are right i'm not working on server. I had tried previously to reload the document with triggers but it is not working .When i close the qvw file and open manually it is working. So i felt that there is another method to reload the document on navigating. But your breif description had given me information how and where it will work.

- Miguel, right now i'm storing a single variable in one txt file. But, if there are multiple variables how can i store into same txt file and use those variables in another qvw file.

Miguel_Angel_Baeyens

Hi,

Regarding your question about variables, and according to the code above, I'd store each value in a different field, so you can later load that file and assign each field to the corresponding variable in the second document, and not using the include variable for this case.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Hi,

I tried with different variables and i can able to store in one txt file. But think is when i'm loading txt file into second qvw file it is loading all variables as one field.

The code is like following in different files:

// First file

VariableTable:

LOAD '$(varName)' AS Variable,

$(vAnotherName) as Variable1             // vAnotherName =1

AUTOGENERATE 1;

STORE VariableTable INTO File.txt (txt);

// Second file

LOAD [Variable,Variable1]

FROM

D:\Examples\File.txt

(txt, utf8, embedded labels, delimiter is '\t', msq);

 

LET vDestinationVariable = FieldValue('Variable', 1);

// LET vDestinationVariable1 = FieldValue('Variable1', 1);

Miguel_Angel_Baeyens

Hi,

Do instead

LOAD Variable,

     Variable1

...

Brackets are used to specify a field name when it contains blanks, special characters or something.

Hope that helps

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Ya..I got the solution. We need to select Delimiter as Comma while loading the txt file.