Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a use case to load two sets of files where the the data in the first file (Table 1) contains duplicate ID rows and only one instance of the same ID in the second file (Table 2). I would like the data from Table 2 to be repeated for each instance of row in Table 1. I am attaching the below image to help illustrate the two tables and the expected result.
I have tried multiple types of Joins but can't see to get the desired outcome and would appreciate if anyone could suggest possible solutions to consider.
Thanks,
Script like this with a left join should work:
Table1:
LOAD ID, Value AS [Table 1 Value]
INLINE [
ID, Value
1, 100
1, 150
2, 250
2, 75
3, 58
3, 36
];
LEFT JOIN (Table1)
//Table2:
LOAD ID, Value AS [Table 2 Value]
INLINE [
ID, Value
1, 100
2, 75
3, 58
];
It returns an output table that looks like this:
Script like this with a left join should work:
Table1:
LOAD ID, Value AS [Table 1 Value]
INLINE [
ID, Value
1, 100
1, 150
2, 250
2, 75
3, 58
3, 36
];
LEFT JOIN (Table1)
//Table2:
LOAD ID, Value AS [Table 2 Value]
INLINE [
ID, Value
1, 100
2, 75
3, 58
];
It returns an output table that looks like this:
Thanks for your feedback, Nicole!
I did try LEFT JOIN but unfortunately my straight table is not behaving as I expect it to. I am not certain if it the load issue or how my table is setup. At the moment, it just appears to return the data from one of the tables. I added a dimension to pull from the second table but does not return any data.
I understand I may not be describing the issue thoroughly here but please let me know if there is something I can add to clarify it better.
Thanks again,
You'll need to add an example QVW file for further help. It's hard to understand what isn't working if you've followed the same steps I have above.
Looks like my issues was due to my expressions. The left join you recommended works as expected.
Thank you so much!