Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
What is the best possible way to create a listbox when data/cell can have multiple values?
Sample Data
AA
AA, BB
CC,DD,AA,BB
DD,BB
BB
EE
How to create a List Box with following selection for the user:
AA
BB
CC
DD
EE
So
if the user selects AA, then following items should be highligted from the table AA - AA, BB - CC, DD, AA, BB
if the user selects BB, then following items should be highlighted from the table AA,BB - CC, DD, AA, BB, DD, BB
If the user selects AA and DD, then following items should be highlighted from the table AA - AA, BB - CC, DD, AA, BB, - DD,BB
Thanks!
maybe this?
SampleData:
load * inline [
field
AA
AA, BB
CC,DD,AA,BB
DD,BB
BB
EE
] (delimiter is ';') ;
Link:
load
field,
trim(subfield(field, ',')) as field2
Resident SampleData;
maybe this?
SampleData:
load * inline [
field
AA
AA, BB
CC,DD,AA,BB
DD,BB
BB
EE
] (delimiter is ';') ;
Link:
load
field,
trim(subfield(field, ',')) as field2
Resident SampleData;
Perfect, thanks!
Couple of Follow up....
1. How do you clean up list which is represented in following format?
11
22, 33, 4 4
33,22, 11
4 4,33
22,11,4 4
55
66
/* how do we remove unwanted spaces. Also the Data has space '4 4 ' which is possible so REPLACE funtion won't be appropriate */
2. We created two pie charts using 2 columns derived from subfield() but when we select data from one pie chart the other pie chart doesn't show accurate vaules.? Can you please invesitgate?
1) to remove the space at the begin and at the end of every value you can trim the subfield (table Tmp) and then rebuild SampleData (concat with the id)
SampleData:
load rowno() as id, * inline [
field
11
22, 33, 4 4
33,22, 11
4 4,33
22,11,4 4
55
66
] (delimiter is ';') ;
Tmp:
load id, trim(SubField(field, ',')) as field1, rowno() as id2
Resident SampleData;
DROP Table SampleData;
SampleData:
load id, Concat(field1, ',', id2) as field
Resident Tmp
Group By id;
DROP Field id;
Link:
load
field,
trim(subfield(field, ',')) as field2
Resident SampleData;
2) I don't understand, better if you open a new discussion with an example (.qvw) of the problem
Thanks Again!