Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

Load Fields from Qvd File Based On Selections

Hi,

- I had a table like following code:

Table1:

load * inline[A,B,C,D,E];

- I created a qvd file for table1(Table1.qvd). Now, i want to display all the columns of table1 in the list box for that i written a code like this:

Table2:

load * inline [ Column

                        A

                        B

                        C

                        D

                        E];

- In sheet i taken the listbox with field  " Column " and given Presentaion as " LED CheckBoxes".

Now my task is based on selection in the list box i want to load the created qvd file(Table1.qvd).

For eg:

               If i selected A,B  in the listbox from the Table1.qvd file i should load only A,B columns after clicking the button in the sheet.

1 Solution

Accepted Solutions
deepakk
Partner - Specialist III
Partner - Specialist III

hi,

Try out the attach appliction. Below are the steps to achieve it.

  • Create a Macro to get the selection of Field in variable (comma seprated).

  • Add the Macro in the Select and Change event of the Field. (Goto Document Properties--> Trigger --> Select the Field --> Add Action on Select and Change )

  • Add the Vriable in the Field Column.

Find a sample file in attachment.

Deepak

View solution in original post

11 Replies
Not applicable

Hi,

Maybe I understand you wrong. But you can't load data from a .qvd vía clicking a button. You must load the .qvd in whole in the script so it become a part of your data model. Then you can make selections based on all data loaded...

/@Ungvall

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

sorry..I already loaded qvd file in script. To Reload qvw file i return macro in the button. Based on selections in the list box  i want to load qvd file.

" I got the solution for my query "

- But it is not working if i select ' ALL the data ' in the listbox. Otherwise it is working fine I mean when i select A or A,B or A,B,C etc.

deepakk
Partner - Specialist III
Partner - Specialist III

hi,

Try out the attach appliction. Below are the steps to achieve it.

  • Create a Macro to get the selection of Field in variable (comma seprated).

  • Add the Macro in the Select and Change event of the Field. (Goto Document Properties--> Trigger --> Select the Field --> Add Action on Select and Change )

  • Add the Vriable in the Field Column.

Find a sample file in attachment.

Deepak

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Hi Deepak,

Your code is working superb. But, In my qvw file i had taken two sheets for each sheet there is a button to reload the qvw file. If i click the button in sheet1 at that time the table with " Column " field will not load into my qvw file and if i click the button in sheet2 then the table with "Column " field will be loaded.

- This is b'coz i had taken a conditon in script to load tables.

- When i'm reloading the Fields in the "Feild event triggers" are updating with new fields. So, whatever Action given for "column" field is missing.

How can i overcome this.

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

- But i got solution . if i  select only few not all..

- I had created one variable (vtest) and in button with action variable(vtest) , =GetFieldSelections(Column,',')

- In script as same as $(vtest).

deepakk
Partner - Specialist III
Partner - Specialist III

cool..... .. best of luck... for future challenges..

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Deepak what is the solution if i select all in the listbox.......thankq

deepakk
Partner - Specialist III
Partner - Specialist III

hi,

If you select all fields, all the fields will get stored in the variable.

Check my application.

Deepak

Not applicable

Hi, jagannalla

Can you share your application please

Vladimir