Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
heij1421
Partner - Creator
Partner - Creator

How do I link tables with a filter

Hi,

I have the following tables 3 tables with users, General Ledger accounts and a security table

Usertable:
LOAD * INLINE "
Users,
User1,
User2,
User3,
User4
"(delimiter is ',');


GL:
LOAD * INLINE "
GL_Account,
100000,
200000,
300000,
400000,
500000,
600000,
700000,
800000,
900000,
999999
"(delimiter is ',');


Securitylist:
LOAD * INLINE "
UserID, GL_From, GL_To
User1, 100000, 999999
User2, 400000, 800000
User3, 100000, 300000
User3, 700000, 999999
"(delimiter is ',');

 

Out of these tables I want to create a new table where I can see which users is allowed to see which GL Accounts.

The outcome should be a

UserGL_Account
User1100000
User1200000
User1300000
User1400000
User1500000
User1600000
User1700000
User1800000
User1900000
User1999999
User2400000
User2500000
User2600000
User2700000
User2800000
User3100000
User3200000
User3300000
User3700000
User3800000
User3900000
User3999999

 

How do I write a script with this outcome?

Labels (1)
1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

Try this after your Inline loads:

NoConcatenate
OutcomeTemp:
Load *
Resident GL;

Join (OutcomeTemp)
Load *
Resident Securitylist;

Outcome:
Load UserID,
GL_Account
Resident OutcomeTemp
where GL_Account >= GL_From and GL_Account <= GL_To;

drop table OutcomeTemp;

View solution in original post

2 Replies
GaryGiles
Specialist
Specialist

Try this after your Inline loads:

NoConcatenate
OutcomeTemp:
Load *
Resident GL;

Join (OutcomeTemp)
Load *
Resident Securitylist;

Outcome:
Load UserID,
GL_Account
Resident OutcomeTemp
where GL_Account >= GL_From and GL_Account <= GL_To;

drop table OutcomeTemp;

heij1421
Partner - Creator
Partner - Creator
Author

Great, thanks