Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
satishqlik
Creator II
Creator II

variable help

Hi All,

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

Load

Concat(Distinct Country,',') as Country

Resident

Table

Group by Country; 

Let _VallCountry=Peek('Country');

But how do store specefic Countries into variable kindly help.

Thanks,

5 Replies
andrei_delta
Partner - Creator III
Partner - Creator III

hi,

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

let v1=mid(vconcat,1,Index(vconcat,',',25));

let v2=mid(vconcat,Index(vconcat,',',25));

hope it helps,

Andrei

Anil_Babu_Samineni

Try this?

Table:

Load Country, Recno() as RecNo From Table;

Final:

NoConcatenate

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');

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
satishqlik
Creator II
Creator II
Author

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.

andrei_delta
Partner - Creator III
Partner - Creator III

Can you give as an example of what that listbox should look like?

satishqlik
Creator II
Creator II
Author

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.

Load

Country

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

from <table>;

Please correct me in this.where I made wrong..!