Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Dee3
Contributor
Contributor

Get 2 variable in same table

Hi Experts,

I have 2 tables already load into qlik as below.

Table A (For Region/Country code)
Group     GroupName
A10           Asia
A1011     JP
A1012     SG
A1013     MY
A1014     HK
A1015     CN
A11          Europe
A1101     UK
A1102     DE
A1103     FI
A1104     AT
A1105     ES

Table B (For Salesman in the located group)
Salesman     Group
SalesM1        A1011
SalesM2        A1103
SalesM3        A1014

And expecting to display both Region and City for the salesman in one straight table.

Expected Result:
Salesman     Group   GroupName      SubGroup     SubGroupName

SalesM1        A10        Asia                       A1011              JP
SalesM2        A11        Europe                 A1103              FI
SalesM4        A10        Asia                       A1014              HK

Any ideas? thanks

Labels (4)
1 Reply
PrashantSangle

try below

Group:

Load Group, GroupName from tableA where len(Trim(Group))=3; 

SubGroup:

Load Group as SubGroup, GroupName as SubGroupName from tableA where len(Trim(Group))>3;;

TableB:

Load Salesman, Left(Group,3) as Group, Group as SubGroup From TableB;

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂