Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
madhubabum
Creator
Creator

Update new data

Hi Experts

I am having the following data set

  OLD_DataSet:

Wo_Pk  Hours Status

100        15        Complete

101         20        Complete

105         30       Pending

107         40       Complete

108         30       Pending

NEW_DataSet:

Wo_Pk  Hours Status

100        15        Complete

101         20        Complete

105         30      Complete

107         40       Pending

108         30       Complete

110          10      Complete

In the above highlighted records are modified ,

Here i want to update the records based upon the "Wo_Pk".(Based upon the requirement 'No need to create Common Key')

i) update newly added records

ii) Add newly added records from NEWDataSet

Please help me, to write the Script

Thanks

Madhu

10 Replies
Anonymous
Not applicable

Hi Madhu,

Any date field is there to track the changes in your source?

If so, you can use incremental load to achieve the above logic.

Regards,

Leni Balakrishnan

madhubabum
Creator
Creator
Author

thanks for reply

I don't have date field, I have only 'Wo_Pk' as primary key

Kushal_Chawda

There should be Modified to pull updated data so that you can do the incremental load

See the below link

http://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/

Kushal_Chawda

When record is updated some field values gets modified, but in your case not even status is modified then how can you say it is modified?

jonathandienst
Partner - Champion III
Partner - Champion III

Your question is confusing.

>>In the above highlighted records are modified ,

No they are not -- There is no difference between old and new for the hightlighted lines, so I have no idea what you are trying to achieve.

>>i) update newly added records

>>ii) Add newly added records from NEWDataSet

What is the difference between these two? You cannot update them if they have not been added, and why do you need to update them if you have just added them?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
madhubabum
Creator
Creator
Author

Sorry Jonathan Dienst

OLD_DataSet:

Wo_Pk  Hours Status

100        15        Complete

101         20        Complete

105         30       Pending

107         40       Complete

108         30       Pending

NEW_DataSet:

Wo_Pk  Hours Status

100        15        Complete

101         20        Complete

105         30      Complete

107         40       Pending

108         30       Complete

110          10      Complete

this is my data set

jonathandienst
Partner - Champion III
Partner - Champion III

How can you tell, without reading the entire data set, what has changed?

Are the Wo_PK value continually increasing (so that new Wo_Pk values will be greater than older ones)? And is there some status which will indicate that no more updates are coming through (eg Complete)?

If both of these conditions are satisfied, then you can do an update style incremental load by doing the following:

  1. Determine the lowest possible Wo_Pk value in thw QVD that is not complete.
  2. Load from your database everything with a W0_Pk greater than or equal to this number.
  3. Load from the QVD everything with a W0_Pk less than this number.
  4. Save the result in the QVD.


It is not as efficient as having a last updated date, as you will often be reading unchanged statuses from the database, but it may still be worthwhile because you do not need to load completed Wo_Pk values.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
madhubabum
Creator
Creator
Author

Thanks for reply ,

In my data set values are changing like 110,115,90,67,...150,....

How we can update and insert records  based on "Wo_Pk"

jonathandienst
Partner - Champion III
Partner - Champion III

Then an update type incremental load is not possible as you have to load the entire dataset anyway to determine what has changed.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein