Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There
I have requirement like below, for display code as per the Country as below. Considering we have more that 50 countries and ID for following countries only should be display.
e,g when Country = GB , show Code = ID-UK
Country Code
GB | ID - UK |
JP | ID - JAPAN |
US | ID-N. AMERICA |
KY | ID-N. AMERICA |
NA | ID-N. AMERICA |
SG | ID-AP EX JAPAN |
KR | ID-AP EX JAPAN |
AU | ID-AP EX JAPAN |
HK | ID-AP EX JAPAN |
Thanks in advance,
I was able to resolve it using nested if statement and match function.
Thanks all....
Sorry, what do you need? Please add more details.
Country is column value I am getting around 50 countries, based below list of counties Code Column value should be derived.
Country | Code |
GB | ID - UK |
JP | ID - JAPAN |
US | ID-N. AMERICA |
KY | ID-N. AMERICA |
NA | ID-N. AMERICA |
SG | ID-AP EX JAPAN |
KR | ID-AP EX JAPAN |
AU | ID-AP EX JAPAN |
HK | ID-AP EX JAPAN |
In simple words
IF (Country='GB', 'ID - UK') as Code
IF (Country='JP', 'ID - Japan') as Code
IF (Country='US', 'ID - N. America') as Code and so on....
I'm not sur understand exactely your request.
did you try mapping load et applymap in your script?
you load your Country table with field Country and Code
you then can define a listbox with your field "Code"
or if you define a table, a Chart whatever, you use Dimension Coder instead of Country
Just use QV's associative logic.
Create a table in your data model that links to your Country field:
LOAD * INLINE [
Country,Code
GB,ID - UK
JP,ID - JAPAN
US,ID-N. AMERICA
KY,ID-N. AMERICA
NA,ID-N. AMERICA
SG,ID-AP EX JAPAN
KR,ID-AP EX JAPAN
AU,ID-AP EX JAPAN
HK,ID-AP EX JAPAN
];
Then you can use Code for selections and as dimension in your charts.
To be honest it would be easier and better performance to either create in excel and load into your model or load inline as a one off exercise. All those if statements will make performance an issue if you have a large number of records to join off. Also easier to maintain a list than go in to update the qvw each time.
Regards
Andy
I was able to resolve it using nested if statement and match function.
Thanks all....