Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Sense community,
I have a requirement that I should show list of field names on one List Box and upon selection of one value (which is the Field Name) the other List Box will show the values that are in the selected Field.
For example, imagine I have a data model with table like below:
Country | Region | Team | Group | CC | Division |
USA | Region 4 | Team2 | GA | 1200 | II |
Canada | Region 3 | Team1 | GD | 1450 | III |
India | Region 2 | Team2 | GC | 4586 | I |
South Africa | Region 3 | Team1 | GC | 2252 | IV |
Spain | Region 1 | Team2 | GA | 1020 | I |
Mexico | Region 5 | Team4 | GR | 5620 | V |
Germany | Region 2 | Team5 | GV | 2000 | VI |
The First List Box will have the list of selected Field Names. One value can be selected and data will not be filtered at this time.
Country
CC
Group
Team
Second List Box will populate the list of field values for the selected field in the First List box. Assuming "Group" is selected, in the Second List box I need to see and be able to select from the list below to filter the data.
GA
GC
GD
GR
GV
Thank you
Hi Alex,
For the first listbox you need to create a island table with the fields required.
This is the code for generating all the fields
For t = 0 to Nooftables() -1
For f = 1 to NoOfFields(TableName($(t)))
tables:
Load
TableName($(t)) as table_name,
FieldName($(f),TableName($(t))) as field_name
Autogenerate 1;
Next f
Next t;
For the second filterbox:
you can use the expression:
=GetFieldSelections(field_name)
-Karthik
Hi Alex,
For the first listbox you need to create a island table with the fields required.
This is the code for generating all the fields
For t = 0 to Nooftables() -1
For f = 1 to NoOfFields(TableName($(t)))
tables:
Load
TableName($(t)) as table_name,
FieldName($(f),TableName($(t))) as field_name
Autogenerate 1;
Next f
Next t;
For the second filterbox:
you can use the expression:
=GetFieldSelections(field_name)
-Karthik
Thank you Karthik.
It works with little update on the second filter. =[$(=GetFieldSelections([Filter Field]))] . I copied the expression from Vegar's suggestion.
Ok Thanks Alex. Noted