Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Duplicate data in incremental load

Hi All,

I am facing an issue that i am getting duplicate  set of record for particular id

I am fetching the data from qvd fetching data on daily basis

  

IDOrgLvl3FlagOrgLvl4FlagOrgLvl5FlagIssueFlagOrgLvl3OrgLvl3OldOrgLvl4OrgLvl4oldOrgLvl5OrgLvl5old
123123ChangeChangeChangeModifiedXXX YYY ZZZ
123123No ChangeNo ChangeNo ChangeNot ModifiedXXXXXXYYYYYYZZZZZZ

$(vLatestFile_Snapshot):

LOAD distinct

      [Issue ID],

     [Organisation Level 3 (Issue)] ,

     [Organisation Level 4 (Issue)] ,

     [Organisation Level 5 (Issue)] ,

  // Floor (MakeDate(2017,08,08)) as

    System_Transaction_Date

FROM

$(vLatestFileName)(qvd);

left join($(vLatestFile_Snapshot))

LOAD distinct

     [Issue ID],

     [Organisation Level 3 (Issue)] as  [Organisation Level 3 (Issue) old],

     [Organisation Level 4 (Issue)] as  [Organisation Level 4 (Issue) old],

     [Organisation Level 5 (Issue)] as  [Organisation Level 5 (Issue) old]

FROM

$(vTransformQVD)\OrionDailySnapshot\$(vPrevFile_Snapshot).QVD(qvd);

$(vOrionTableName):

Load *,

if(Orglevel3Flag='Change' or Orglevel4Flag='Change' or Orglevel5Flag='Change','Modified','Not Modified')as RiskIssueFlag;

NoConcatenate

Load distinct  *,

if([Organisation Level 3 (Issue)]= [Organisation Level 3 (Issue) old],'No Change','Change') as Orglevel3Flag,

if([Organisation Level 4 (Issue)]= [Organisation Level 4 (Issue) old],'No Change','Change') as Orglevel4Flag,

if([Organisation Level 5 (Issue)]= [Organisation Level 5 (Issue) old],'No Change','Change') as Orglevel5Flag

Resident $(vLatestFile_Snapshot);

Drop Table $(vLatestFile_Snapshot);

Concatenate($(vOrionTableName))

LOAD [Issue ID],

     [Organisation Level 3 (Issue)],

     [Organisation Level 4 (Issue)],

     [Organisation Level 5 (Issue)],

     System_Transaction_Date,

     [Organisation Level 3 (Issue) old],

     [Organisation Level 4 (Issue) old],

     [Organisation Level 5 (Issue) old],

     Orglevel3Flag,

     Orglevel4Flag,

     Orglevel5Flag,

     RiskIssueFlag

FROM

D:\WorkArea\Shweta\Org Hier data\$(vOrionTableName).qvd

(qvd);

STORE  $(vOrionTableName) into D:\WorkArea\Shweta\Org Hier data\$(vOrionTableName).qvd(qvd);

11 Replies
Anonymous
Not applicable
Author

No I think you  haven't understand the issue.

We loading the data from daily qvd,which comapre cureent date and prev date qvd data.Where first qvd of 20/08/2017include 123123 ID,but this is not exist in  19/08/2017 qvdin first load,main.qvd is not exist , entire code run before concatenation &the data stored in main qvd.

In second we are comparing  21/08/2017 and 20/08/2017 qvd as the ID 123123 ins already exist  in 20/08/2017  and also exist in 21/08/2017. it compare and generate the line of "No change". and it gets concatenate with main qvd which include the data 20/08/2017 "Change" record in Org Level3 ,it will generate 2 line for single ID

PunamWagh
Contributor III
Contributor III

Hope this will help you