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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Flag not updating based on condition

Hi all,

My requirement is to load data from excel to oracle table with below conditions

Table columns are 

cust_no,Name,Item,Orders,Location,Flag

cust_001, John, Watch,3, Mumbai, I-------------------->flag should change

1.If record already exists in table then FLAG column should change from "I" to "U"

Expected output:

cust_no,Name,Item,Orders,Location,Flag

cust_001, John, Watch,3, Mumbai, U---------------------->Already existing record on table 

cust_002, Mathew, Bag, 3, Bangalore, I

cust_001, John, Watch,3, Mumbai, I-------------------->record from excel should insert like this

My job design looks like below screenshot

0683p000009LtiL.png0683p000009LutW.png0683p000009Luqs.png

 

The problem is new records from excel inserting with flag "I" but  existing record flag is not Insert as the new record it just update the existing record Flag

1.InsertRec--->output-->action on table --->Insert

2.Update -->output-->action on table -->Tried with Insert or update  ,update or insert,update but it's not  inserting as new record

When I tried with Insert as action on table it is inserting the record which is already in table is as below

cust_no,Name,Item,Orders,Location,Flag

cust_001, John, Watch,3, Mumbai, U

 

when I work with start_date,end_date using SCD component it's giving me exactly what I'm looking for.

 

Hope you understand the problem.

 

As soon as possible please help me to resolve this!

Thanks in advance

Labels (1)
21 Replies
Anonymous
Not applicable
Author

Hi Sara,

Can you please show me how you wrote expression for if record already present in DB.
It would help me, if you will share and explain me how will you implement.
I saw your another post where you were implementing SCD type2 without using SCD compoenent. if you achieve this can you please tell how did you do that because i am implementing SCD type 2 without using SCD component but i am confuse with expression when i want to update record with flag Start date and end date.

Thanks,
Arpit
Anonymous
Not applicable
Author

Hi Shong0683p000009LtJP.png0683p000009LtM3.png0683p000009Lspz.png0683p000009LtOU.png,

 

I am implementating SCD type2 without using SCD component in talend but i am not getting Startdate and End as par my requirement.

Requirement is:

1.If data is fresh then start date will set as current date and end date as null.

2.if data is already exist in DB but one attribute changed that data then what it should do for previous record end date should be as current date and for new updated record start date as current date and end date will be null.