Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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.
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.
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
Concatenate
LOAD Sls_Units_mcom_all, margin_mcom_all,'2' as Table2
FROM
Concatenate
LOAD sls_units_common, margin_common, '3' as Table3
FROM
DROP Tables Table1. Table2, Table3;