Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Can i create a single list box based on multiple columns?

how do I create a single list box from the column values of multiple columns

please let me know

10 Replies
swuehl
MVP
MVP

The more important question is:

What do you expect to happen when you make selections in this list box?

Anonymous
Not applicable
Author

when I make a selection of a value from list box the selected value should be selected in the chart , it might be in muitple rows , so say for example Rome has ids 1 and 2 and the data in my chart has rows 1- 10 , I need to display both 1 and 2 rows as value Rome is in both the rows.

swuehl
MVP
MVP

Still not sure if I understand what you are trying to achieve.

If you have a table like

T:

LOAD * INLINE [

ID, Country, City

1, Italia, Roma

2, Italia, Firenze

3, France, Paris

4, France, Nice

];

you can load the field values of Country and City into a single field 'Value' like this, linking to the original table by ID

CROSSTABLE (Field, Value)

LOAD * Resident T;

Then, creating a listbox for field Value, selection in field Value will filter the records in table T.

Anonymous
Not applicable
Author

OK , Let me try to explain you one more time ,below is my sample data

I want a filter with all the students names under class1,2,3 .. so that when I filter on Vicky I would see id - with 1 and 2

Hope this makes sense !

   

ID DATETeacherClass 1Class 2Class 3
11/1/2015TomVickyJohnSam
21/2/2015EricNickrVickyKevin
31/3/2015CatalinaKevinZaraNull
swuehl
MVP
MVP

Ok, I think the solution I proposed above will solve your request: Transform your table from a cross table into a straight table using a CROSSTABLE LOAD:

CROSSTABLE (Class, Student, 3)

LOAD ID,

          DATE,

          Teacher,

          Class1,

          Class2,

          Classe3

FROM YourTable;

[Assuming you haven't loaded YourTable so far. If you want to keep YourTable in the data model, remove DATE and Teacher from the CROSSTABLE LOAD and set the third parameter from 3 to 1 (number of fields not to transform). ]

Then you can select 'Vicky' from a 'Student' list box.

Anonymous
Not applicable
Author

Sorry , but I quite didn't get it , I don't have Class or Student columns in the sample data ? What are they refereeing to? I get 3 is referring to 3rd parameter ...

CROSSTABLE (Class, Student, 3)

swuehl
MVP
MVP

Class and Student fields will be generated by QV from your fields Class1, Class2, Class3, ...

I suggest that you run the script I posted above and have a look at

The Crosstable Load

Anonymous
Not applicable
Author

Ok Thank you ... I think I am almost there .. can you please tell how I can make all this in one table .. the cross table is getting to the main table on class1 .. how to I avoid that .. can I get all the value including Student in one table ?

swuehl
MVP
MVP

Can you post your current script (the main table LOAD and the CROSSTABLE LOAD)?