Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
A have a data base with a column with | seperated values.
is it possible to create a listbox that searches for all seperate values
example
database column
id country
1 england|holland|sweden
2 China|Rusia|Vietnam
3 Greece|germany|england
I want a listbox that will contain all countries and will display id 1 and 3 if england is selected.
I have tried = SubField(country,'|') in the expression in t\he general tab in List Box but get strange results.
Anyone??
@ !
Why not do it in the script by creating a linktable
Table:
LOAD id,
country as CountryConcatenated
FROM Source;
LinkTable:
LOAD Distinct CountryConcatenated,
SubField(CountryConcatenated, '|') as Country
Resident Table;
Now you can use Country as your list box.
In the current listbox, use a wildcard search for *england*, press enter and you'll select all concatenated strings that carry the text england somewhere. The standard QlikView search can do some pretty amazing things.
Thank you for the solution but this way my data gets very big because all variables will be repeated for each country.
that is why I concatenated the countrynames. I am trying to find a way to search within this field.
Thank you Peter
I want to give the users a listbox with the names of the possible counties where they can pick a county.,
This transformation will be part of a separate table which will keep the size of your fact table intact. It is only going to be impacting a link table.
Well you create the CountryConcatenated which will be linked to the table1. It creates a new record if there is more then 1 country.
table1
1 england|holland|sweden
2 england|holland|sweden
3 england|holland|sweden
will become
1 england|holland|sweden england
1 england|holland|sweden holland
1 england|holland|sweden sweden
2 england|holland|sweden england
2england|holland|sweden holland
etc
I guess it does, but the size of fact table is still the same. This increase in size is a supplemental table which should not negatively effect performance. Not sure if there is another way to do this. May be someone else have better ideas