locked
Advice Needed combining data RRS feed

  • Question

  • Hi,

     

    I need a bit of advice and couldnt find any posts that seemed to match. I am trying to build a Sales Report using PowerPivot pulling data from our SQL server.

     

    In the sale's i need to pull data from 

     

    Sale Header & Sales Line Tables

    Sales Header Archive & Sales Line Archive Tables

     

    But I need these document dates and value's to appear in the same columns, is there any way of combining the Archive and Live versions of each table together in order to do this? Or what would you advise would be the best approach?

     

    Thanks a million.

    Fionn

    Wednesday, August 18, 2010 10:32 AM

Answers

  • Instead of using "Select from a list of tables and views..." use "Write a query that will specify..." and create a UNION query.

    eg.

    SELECT ha.col1, ha.col2..

    FROM SalesHeaderAchive ha

    UNION

    SELECT h.col1, h.col2...

    FROM SalesHeader h

    • Marked as answer by Fionny Thursday, August 19, 2010 10:46 AM
    Thursday, August 19, 2010 5:28 AM

All replies

  • Instead of using "Select from a list of tables and views..." use "Write a query that will specify..." and create a UNION query.

    eg.

    SELECT ha.col1, ha.col2..

    FROM SalesHeaderAchive ha

    UNION

    SELECT h.col1, h.col2...

    FROM SalesHeader h

    • Marked as answer by Fionny Thursday, August 19, 2010 10:46 AM
    Thursday, August 19, 2010 5:28 AM
  • Thank you so much! Im a total beginner at this! I really do applicate the help!

     

    Regards,

    Fionn

    Thursday, August 19, 2010 10:47 AM