Forum Discussion

benjamin_sasin's avatar
benjamin_sasin
Resolver I
6 years ago

Compare queries for data lacking time stamps

I'm dealing with data from a 20 years old Oracle dabase that's got no timestamps and no indexing.

 

When querying, I would like to be able to compare the content of the query with that of the previous query, and see changes--and if possible, even mark the rows that changed with the latest query date.

 

Is this possible with Power Query alone? And if so how?

 

6 Replies

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi benjamin_sasin 

     

    Sure, you can use Marge Queries as below.

     

    Then 

    • Select Both queries you wish to compare.
    • Choose a set of columns that have the desired link between them.
    • Pick king of join "full outer" for example if you want to compare common and missing records on both ends.

    The below link will explain the process in more detail.

    https://www.excelguru.ca/blog/2015/10/28/merge-data-based-on-two-columns/

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski


       

    • benjamin_sasin's avatar
      benjamin_sasin
      Resolver I

      Hi,

       

      Thanks, but I'm not quite sure to understand how merging queries will help me tag rows of the newest queries that has changed.

       

      So imagine the value in the SECOND row below colum TOQUARTER was 3 yesterday, and today it is 4. There is no way for me currently to notice this as a "LastUpdate" timestamp is missing on the row. Secondly the row is not indexed, so I the assumption is the data is queries in the same order today as it was yesterday.

       

      How can I notice the change using power query, and applying a timestamp of today (query time) on the second row, to mark the change?

       

      APPTYPEACADEMICYEARQUARTERMODULEAPPCODEPROGCODEPREFIXCODEFNAMEMNAMELNAMEFNAME2MNAME2LNAME2STDCODEUNIVERCODESTATUSAPPSTATDDATERESONCODETOACADEMICYEARTOQUARTERTOMODULE
      A20191162S002002001John-Doe---S620020   --E-4202042
      A20191162S002102001Mary-Jenkins---S620050   --E-4202031
      A20191162S002202001AlfonzoLeonardoLeppe------E-5201922
      A20191162S002402001Cheng-Zhao------E-4202031
      A20191162S002602002Suman-Mhuammad---S620030   --E-4201942
      A20191162S002702001Tang-Duong---S620032   --E-7202031
      A20191162S002902001Warren-Spade---S620031   --E-4202021
      A20191162S003002001Gwendolin-Flendich---S620019   --E-4202012
      • Mariusz's avatar
        Mariusz
        Community Champion

        Hi benjamin_sasin 

         

        If you are compering change overnight you can.

        1. if you have scheduled job to update this table, adjust the stored procedure to check for changes and time stamp the records in oracle db.
        2. You can create a data flow in power bi service and take a daily snapshot of your table and later compare it in Query editor.

         

        Best Regards,
        Mariusz

        If this post helps, then please consider Accepting it as the solution.

        Please feel free to connect with me.
        Mariusz Repczynski

         

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi benjamin_sasin 

     

    The short answer is yes however if you are looking for a solution please can you create a sample of data that you wish to compare.

     

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

    • benjamin_sasin's avatar
      benjamin_sasin
      Resolver I

      Sure thanks!

       

      Here is a sample data from one of many such tables (names have been altered and any resemblence with real names is pure coincidence):

       

      APPTYPEACADEMICYEARQUARTERMODULEAPPCODEPROGCODEPREFIXCODEFNAMEMNAMELNAMEFNAME2MNAME2LNAME2STDCODEUNIVERCODESTATUSAPPSTATDDATERESONCODETOACADEMICYEARTOQUARTERTOMODULE
      A20191162S002002001John-Doe---S620020   --E-4202042
      A20191162S002102001Mary-Jenkins---S620050   --E-4202031
      A20191162S002202001AlfonzoLeonardoLeppe------E-5201922
      A20191162S002402001Cheng-Zhao------E-4202031
      A20191162S002602002Suman-Mhuammad---S620030   --E-4201942
      A20191162S002702001Tang-Duong---S620032   --E-7202031
      A20191162S002902001Warren-Spade---S620031   --E-4202021
      A20191162S003002001Gwendolin-Flendich---S620019   --E-4202012