Forum Discussion

Tuan's avatar
Tuan
Helper III
7 years ago
Solved

Merging Two Data Tables (Invoice and Orders)

I'm trying to merge invoice and orders together with the exclusions of orders that already been invoiced.

 

I have my Invoice Data as

InvoiceCustomerValue
1000ABC100
1001Bee200
1002Cali300
1003Burrito

400

And my order data as 

 

InvoiceOrderCustomerValue
1000201ABC100
1001202Bee200
1002203Cali300
1003204Burrito400
 205ABC100
 206ABC200

 

 

I want the end data to look like 

 

Transaction TypeInv/OrderCustomerValue
Invoice1000ABC100
Invoice1001Bee200
Invoice1002Cali300
Invoice1003Burrito400
Order205ABC100
Order206ABC200

 

Is there a guide that shows how I can do this?

  • Anonymous's avatar
    Anonymous
    7 years ago

    If the order is invoiced you have invoice number, else you have just order number alone & invoice number is blank. So allrequied details are available in order table itself.

     

    Create the below 2 columns and drag along with customer and value columns from the Order table. 

     

    Invoice/order = IF( ISBLANK( Order[InvoiceNo]), Order[OrderNo],Order[InvoiceNo])

     

    TransactionType= IF( ISBLANK( Order[InvoiceNo]), "Order","Invoice")

     

    Hope this helps.

     

    Thanks

    Raj

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    If the order is invoiced you have invoice number, else you have just order number alone & invoice number is blank. So allrequied details are available in order table itself.

     

    Create the below 2 columns and drag along with customer and value columns from the Order table. 

     

    Invoice/order = IF( ISBLANK( Order[InvoiceNo]), Order[OrderNo],Order[InvoiceNo])

     

    TransactionType= IF( ISBLANK( Order[InvoiceNo]), "Order","Invoice")

     

    Hope this helps.

     

    Thanks

    Raj

    • Tuan's avatar
      Tuan
      Helper III

      There is much more data then those listed columns. Just made it smaller as an example.

      • Anonymous's avatar
        Anonymous
        Not applicable
        Still this will work. Did you try the above approach?