3 Replies Latest reply: May 21, 2016 12:47 PM by Gysbert Wassenaar RSS

    How to load only updated data from MySql to qlik Sense and update Dashboard?

    Ravinder Rawat

      The error occurred here:

      RequestedNew:

      Load *

      from RequestedTrips

      Where created_at > 2016-05-17 13:50:01

       

      Please help?

        • Re: How to load only updated data from MySql to qlik Sense and update Dashboard?
          Gysbert Wassenaar

          Usually there's a bit more info that also has some clues as to what error occurred. Can you post the 10 lines before and after the part you posted above?

          • Re: How to load only updated data from MySql to qlik Sense and update Dashboard?
            Ravinder Rawat

            //PHASE 1 ------------------------ Load Data from MySql Database

             

            // RequestedTrips:

            // load *;

            // sql

            // select

            // `requested_trips`.`id` as "Trip ID",

            //     if(`requested_trips`.`start_date`>'2016-05-01',

            //     `requested_trips`.`start_date`,

            //         null)

            //     as "Trip Start Date",

            //     convert_tz(`requested_trips`.`created_at`,'+00:00','+05:30') as "created_at",

            // convert_tz(`requested_trips`.`updated_at`,'+00:00','+05:30') as "updated_at"

            // FROM requested_trips

            // where created_at > '2016-05-18  13:50:01';

             


            //PHASE 2--- Load updated data only from MySql Database on the basis of last created date--------------------

             

             

            //Last Created date

            let Last_Created_Date = peek('created_at',-1,'RequestedTrips');

             

            IncrementalData:

            Noconcatenate

            load *;

            sql

            select

              `requested_trips`.`id` as "Trip ID",

                `requested_trips`.`start_date` as "Trip Start Date",

                 convert_tz(`requested_trips`.`created_at`,'+00:00','+05:30') as "created_at",

              convert_tz(`requested_trips`.`updated_at`,'+00:00','+05:30') as "updated_at"

            FROM requested_trips

            where created_at > $(Last_Created_Date);

             

            Concatenate

            LOAD *

            Resident RequestedTrips

            where not Exists(Trip ID);

             

            Drop Table RequestedTrips;

            Rename table IncrementalData to RequestedTrips;

             

            need Help..?