Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
viveksingh
Creator III
Creator III

Update records after loading

Hi Experts,

I have loaded an excel file and have few update statements that needs to update the records that are loaded already.

Below is sample one

ACCOUNT:

NAME  NO AMOUNT DEPT

ABC    10   5000  HR

DEF    10  5500   IT

GHI     20  2000   IT

Now I have update statement  that are in sql. like below

Update ACCOUNT SET NAME='XYZ' where NO=10 and DEPT='IT'

Is there any way to achieve the above ?

Thanks,

Vivek

7 Replies
muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

No, We can't do update process in qlikview. Qlikview for only analysis the data.

Muthukumar Pandiyan
Anil_Babu_Samineni

Can you check this on your environment

Sales:

LOAD * INLINE [

ID, Name, Sales

1, Anil, 10

2, Babu, 20

3, Samineni, 30

];

STORE Sales into Sales.qvd (qvd);

DROP Table Sales;

Sales:

LOAD ID,

  Name,

  If(Name = 'Samineni', 40, Sales) as Sales

From Sales.qvd (qvd);

STORE Sales into Sales.qvd (qvd);

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
adamdavi3s
Master
Master

The only way you could do this is to do some preceding loads or mapping loads or left joins but its possible for sure.

adamdavi3s
Master
Master

Here is the code for left joins to do it, its a bit fiddly but it works

ACCOUNT:

LOAD * INLINE [

NAME,  NO, AMOUNT, DEPT,

ABC,    10,  5000,  HR,

DEF,    10,  5500,  IT,

GHI,    20,  2000 ,  IT,

];

//do a left join to update a new column

LEFT JOIN (ACCOUNT)

LOAD 'XYZ' as NEWNAME, 10 as NO, 'IT' as DEPT

autogenerate(1);

//second left join to fill in the blanks

LEFT JOIN (ACCOUNT)

LOAD IF(len(NEWNAME)<1,NAME,NEWNAME) as FINALNEWNAME, NO, AMOUNT,DEPT

RESIDENT ACCOUNT;

DROP FIELDS NAME,NEWNAME;

RENAME FIELD FINALNEWNAME to NAME;

adamdavi3s
Master
Master

Here is a simple preceding load

ACCOUNT:

LOAD NO,AMOUNT,DEPT,if(NO=10 AND DEPT='IT','XYZ',NAME) as NAME;

LOAD * INLINE [

NAME,  NO, AMOUNT, DEPT,

ABC,    10,   5000,  HR,

DEF,    10,  5500,   IT,

GHI,     20,  2000 ,  IT,

];

hemachandran
Partner - Creator
Partner - Creator

HI,

  Its not possible in Qlikview. We cant add or change the data once loaded..If  we want to change the data we have to do it in the data source and reload only.

adamdavi3s
Master
Master

did this help? if so please remember to mark this as helpful or the correct answer if I have helped you or answered your question. This will help users identify the answers should they come across this thread in the future.