Forum Discussion

rkaushik's avatar
rkaushik
Frequent Visitor
3 years ago

Matrix table not showing all the values between two tables

Hi everyone,

I have been trying to create a table from two datasets Orders and Prev Orders. 

Orders dataset looks like this:

UniqueIDOrderSign DateProductsAmountPrev OrderPrev Order Unique ID 

1 A

1

01/11/2022A

500

44 A
1 B101/11/2022B10044 B

1 C

1

01/11/2022C30044 C

2 A

2

9/15/2021A50055 A

2 B

2

9/15/2021B10055 B

3 D

3

4/28/2022D700  

Unique Id is just a concatenation of Order and Products.

 

Prev Orders Dataset:

UniqueIDOrderClose DateProductsAmount
4 A401/11/2021

A

600
4 B401/11/2021B200
4 C401/11/2021C500
4 D401/11/2021D600
5 A 59/15/2020A200
5 B59/15/2020B100
6 E64/28/2021E

200

6 F64/28/2021F100

 

The relationship is based on column "UniqueID" from table 2 to "Prev Order Unique ID" from table 1. 

Here's what I am currently getting when creating a table:

OrderTable1.ProductsTable1.AmountTable2.OrderTable2.ProductsTable2.Amount
1A$5004A$600
1B$1004B$200
1C$3004C$500
2A$5005A$200
2B$1005B$100
3D$700   

 

What I need to get:

OrderTable1.ProductsTable1.AmountTable2.OrderTable2.ProductsTable2.Amount
1A$5004A$600
1B$1004B$200
1C$3004C$500
1  4D$600
2A$5005A$200
2B$1005B$100
3D$700   
   6F$100
   6E$200

 

Could anyone help me out with what I am doing wrong here or what can I do to achieve the desired result? Any help would be much appreciated.
Please let me know if I can provide any more information. 

 

Thanks in advance

5 Replies