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: 
Not applicable

Storing selection into qvd

Hi,

     I'm new to qlik view.I'm using records from teradata.I'm having some list boxes I need to store only the selected values from the list box into a new qlikview document on clicking the button object at the same time only the selected values should be displayed in teradata too(using select staement).Please help me out in solving this.Thanks in advance.

1 Solution

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

To create a new QlikView document that contains only the Current Selections you need to select File \ Reduce Data \ Keep Possible Values and then save this.  This should be possible in a macro via the API - but it is not something I have attempted.

As for having QlikView send a selection into TerraData I can't see how it would do this.  The closest I can imagine you could get is building a SELECT statement in a Text Object that the user could copy and paste. This would need something like.  You would need to concatenate a string with the SELECT part then for the where would would need a mix of GetSelectedCount and Concat to create a WHERE EXISTS IN statement.

Hope that points you in the right direction.

Steve

View solution in original post

23 Replies
PradeepReddy
Specialist II
Specialist II

We can use the bookmark option from Menu Bar or from Book Mark object, to store the current selections.

anil2185
Contributor III
Contributor III

What I under stand is to display specific data?

You can put the where condition in the store statement of .qvd, base on your selections.

Regards,

Not applicable
Author

To store the selected data into the qvd file and also display the same in teradata.

Ya ,but I have no idea to get the selected field and storing it to variable.

anil2185
Contributor III
Contributor III

Use GetCurrentSelections()

Not applicable
Author

Ya I tried,but i couldnt use the bookmark name in text box object  to display the selected values.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

To create a new QlikView document that contains only the Current Selections you need to select File \ Reduce Data \ Keep Possible Values and then save this.  This should be possible in a macro via the API - but it is not something I have attempted.

As for having QlikView send a selection into TerraData I can't see how it would do this.  The closest I can imagine you could get is building a SELECT statement in a Text Object that the user could copy and paste. This would need something like.  You would need to concatenate a string with the SELECT part then for the where would would need a mix of GetSelectedCount and Concat to create a WHERE EXISTS IN statement.

Hope that points you in the right direction.

Steve

Not applicable
Author

I tried to save GetCurrentSelections() into a variable and using the where condition as below; But this is not turning up or storing the values as expected;

LOAD cust_id,
     cust_name,
     cust_type
FROM
C:\Users\387805\Documents\cust_type.xlsx
(ooxml, embedded labels, table is Sheet1)
WHERE (cust_id = '$(vS)');

LOAD *;
Store cust_type into cust_type.qvd(qvd);

Not applicable
Author

Hi  ,

   I wrote macro code in the Edit module like this

Sub select_field

set s = ActiveDocument.Fields("V_Id").GetSelectedValues

End Sub

----------------------------------------in Edit script

LOAD cust_id,

     cust_name,

     cust_type

FROM

C:\Users\<User>\Documents\cust_type.xlsx

(ooxml, embedded labels, table is Sheet1)

WHERE (cust_id = $(s));

err_ed.PNG.png

Can you please suggest me how to pass the variable from macro to script.?

.

Not applicable
Author

Passing bookmark name into load/select statement is not possible. It shows error.