Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello there,
I have two tables, Document Table and Comment Table.
Document Table has rows with information, and the only thing I can get from this table is if each document has comments or not. The comments are in the Comment Table.
I am trying to get, for example, if Document A has comments, then I need all Comments listed in the Target Table, as follows:
Any ideas on how to achieve this will be appreciated.
Thank you!
If I am understanding this correctly.
First, you need to create a key between Document table and Comment table since that doesnt exist.
It looks to me like that key is Document and the first letter on the comment table.
So, to create that key on the comment table side and then create your final table I would do the following
TargetTable:
LOAD Document
From DocumentTable.qvd(qvd)
WHERE Has Comment = 'Y';
LEFT JOIN (TargetTable)
LOAD LEFT(Comment,1) as Document
CONCAT(Comment,',') as Comment(s)
From CommentTable.qvd(qvd)
Group by LEFT(Comment,1);
If I am understanding this correctly.
First, you need to create a key between Document table and Comment table since that doesnt exist.
It looks to me like that key is Document and the first letter on the comment table.
So, to create that key on the comment table side and then create your final table I would do the following
TargetTable:
LOAD Document
From DocumentTable.qvd(qvd)
WHERE Has Comment = 'Y';
LEFT JOIN (TargetTable)
LOAD LEFT(Comment,1) as Document
CONCAT(Comment,',') as Comment(s)
From CommentTable.qvd(qvd)
Group by LEFT(Comment,1);
This is perfect. Thank you @WeLoveQlik !!