0

How to do an vertical union in Pyramid?

I want to combine data from two sources but stack the results vertically, even if there's no direct match between the left and right datasets. How can I achieve this?

3 replies

null
    • VP Product Management
    • Ian_Macdonald
    • 3 wk ago
    • Reported - view

    Hi 

    Use the JOIN Block and specify "Full Outer Join" in the join type:

    It doesn't matter what the join fields are.

    You can see the data from both tables stacked in the preview pane.

    Hope that helps.

    Ian

    • Noel_Izoulet
    • 3 wk ago
    • Reported - view

    Hello Ian,

    Thanks for your answer. I am working with Raveena and it's actually not what she meant to say. We want a outer union, so for example table A has columns A and B, table B as columns A, B and C, we want to vertically stack tables A and B, the result table will have columns A, B and C. Is that achievable please ? Thanks, Noel

    • VP Product Management
    • Ian_Macdonald
    • 3 wk ago
    • Reported - view

    Hi  ,

    Yes, use the Union block but make sure the table with the most number of columns is linked to the Union block first, then the table with fewer columns, then any more tables with the same or fewer number of columns. You can also add in the original table name if you want to identify the origin of each record.

    Hope that helps.

    Ian

Content aside

  • Status Answered
  • 3 wk agoLast active
  • 3Replies
  • 31Views
  • 3 Following