Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ashishpalkar
Creator III
Creator III

Data display based on other column value.

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,

1 Solution

Accepted Solutions
ashishpalkar
Creator III
Creator III
Author

I was able to resolve it using nested if statement and match function.

Thanks all....

View solution in original post

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Sorry, what do you need? Please add more details.

ashishpalkar
Creator III
Creator III
Author

Country is column value I am getting around 50 countries, based below list of counties Code Column value should be derived.

  

Country Code
GBID - UK
JPID - JAPAN
USID-N. AMERICA
KYID-N. AMERICA
NA ID-N. AMERICA
SGID-AP EX JAPAN
KRID-AP EX JAPAN
AUID-AP EX JAPAN
HKID-AP EX JAPAN
ashishpalkar
Creator III
Creator III
Author

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....

syukyo_zhu
Creator III
Creator III

I'm not sur understand exactely your request.

did you try mapping load et applymap in your script?

Anonymous
Not applicable

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

swuehl
MVP
MVP

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.

ogster1974
Partner - Master II
Partner - Master II

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

ashishpalkar
Creator III
Creator III
Author

I was able to resolve it using nested if statement and match function.

Thanks all....