Forum Discussion
Merge 2 queries and duplicate rows from one
- 5 years ago
Hi rmwwgs ,
You could create a new table by the following formula:
newtable = VAR _order = GENERATESERIES ( 1, 3, 1 ) VAR _crossjoin = CROSSJOIN ( _order, 'Table (2)' ) RETURN UNION ( 'Table', _crossjoin )The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi rmwwgs ,
You could create a new table by the following formula:
newtable =
VAR _order =
GENERATESERIES ( 1, 3, 1 )
VAR _crossjoin =
CROSSJOIN ( _order, 'Table (2)' )
RETURN
UNION ( 'Table', _crossjoin )
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This one works really well thanks!
The only problem I have now is that not all students are in all report cycles. The new table creates Target entries where there is no corresponding Grade entry for that cycle. Is there any way to filter that out in the UNION by specifying that there must already be a value for that column in the joining Table?