Discussion board where members can get started with QlikView.
Please help me in this scenario.
I have a Country table.
Here I need to store few of Countries into one variable and remaining into another variable.
For example, table contains 75 countries.
#Create Variable1 for 25 Countries;
#Create Variable2 for 50 Countries ;
How to achieve this requirement??
I've tried with Concat to store all Countries into the variable
Concat(Distinct Country,',') as Country
Group by Country;
But how do store specefic Countries into variable kindly help.
i don;t know your criteria for storing into the variables but you can do something like this:
1. have one variable with all the countries (just like the one you created)
2. make 2 new variables one containing the first 25 and the second with the rest of them
hope it helps,
Load Country, Recno() as RecNo From Table;
Load Country, 1 as Flag, Concat(Country,',') as Concat Resident Table Where RecNo>=1 and RecNo<=25;
Load Country, 2 as Flag, Concat(Country,',') as Concat Resident Table Where RecNo>=26 and RecNo<=50;
Load Country, 3 as Flag, Concat(Country,',') as Concat Resident Table Where RecNo>=51 and RecNo<=75;
Drop table Table;
LET Var25 = Peek('Flag',0,'Final');
LET Var50 = Peek('Flag',1,'Final');
LET Var75 = Peek('Flag',2,'Final');
Thanks for all your responses.
The ultimate requirement is,
I need to write expression for conditional display values in list box.
If I have variables for both it will be easy to write condition else I need to write manually.
Can you give as an example of what that listbox should look like?
I have two list boxes Country and Region contains
Country - there are 60 countries
Region contains -E, W, N, S
Now I need to display values based on Specific Country selections.
For example, US and UK and Canada need to restrict all Regions except Region "S"
and Remaining Countries restrict only Region "S" .
I have done in script and not working as I expected.
If(Match(Country,'US ','UK','Canada'), Pick(Match(Region,'S'),Region) ,
If(Match(Country, all remaining countries except UK,US and Canada),
Pick(Match(Region,'N','E','W'),Region,Region,Region))) as Region
Please correct me in this.where I made wrong..!