Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to make displayed x & y values come from different tables depending on user listbox selection

I have a list box with 3 values.  If the user selects value 1 the data for the scatter chart should take its x & y values from one table. If the user selects value 2 the data should take its x & y values from a different table, and if the user selects both values the data should come from a third table.  How do I best do this?

3 Replies
nagaiank
Specialist III
Specialist III

Concatenate the three tables using the script

AllTables:

LOAD x,y,'1' as TableNo from .... Table1;

Concatenate

LOAD x,y,'2' as TableNo from .... Table2;

Concatenate

LOAD x,y,'3' as TableNo from .... Table3'

DROP Tables Table1. Table2, Table3;

Listbox will be for the field TableNo.

Not applicable
Author

Still can't get it to work.  Perhaps I should rephrase the problem.

I have a table "Type" that has one column containing a "1" or a "2" or a "3".  I would like to make this a list box, such that if the user selects "1" I will be able to graph two particular fields on a scatter graph.  If the user selects "2" I will be able to graph two other fields, and likewise if the user selects "3" yet still two other fields.  Namely, which values (columns from the original spreadsheet) are to be graphed depends on the user's selection.

Not applicable
Author

If I follow the original answer, I get three tables, Table1, Table2 and Table3, with a 1, 2, or 3 in them respectively.  The tables do not get dropped, and I get an error message on the DROP command saying that it can't find Table2.

Code follows:

LOAD Sls_Units_mds_all, margin_mds_all, '1' as Table1

FROM (ooxml, embedded labels);

Concatenate

LOAD Sls_Units_mcom_all, margin_mcom_all,'2' as Table2

FROM (ooxml, embedded labels);

Concatenate

LOAD sls_units_common, margin_common, '3' as Table3

FROM (ooxml, embedded labels);

DROP Tables Table1. Table2, Table3;