Discussion Board for collaboration on QlikView Scripting.
the title might be confusing but here is the idea:
I have 2 tables and I want to join both tables, but....
here is the case:
The expected result is:
I want to show which code belong to which CodeGroup and GroupName.
Thanks for your help
Go to Solution.
You can build an intermediate lookup table to join the two tables as this ...
LOAD Code, text(left(Code,5)) as Key resident Table1;
LOAD Code, text(left(Code,6)) as Key resident Table1;
LOAD Code, text(left(Code,7)) as Key resident Table1;
inner join (Lkp)
LOAD text(CodeGroup) as Key, GroupName resident Table2;
Note the text statement around the Code field as the CodeGroup values are numeric whereas the Codes are not.
If that are the only data you have to join, you could create two fields in both tables with the first 5,6 characters so you will have the Keys to join the tables.
Left(Code,5) as %Key,
Left(Code,6) as %Key2
if(len(CodeGroup)=5,Left(CodeGroup,5)) as %Key
if(len(CodeGroup)>5,Left(CodeGroup,6)) as %Key2
I ' ve don't try this, hope this helps
Hi, thanks for ur help btw.
I havent tried any of the solution
but once Ive tried, i will inform my progress.
Your solution worked like charm.
Thank you so much.