Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Partner
Partner

Hi,

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

Muthukumar Pandiyan
Highlighted

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);

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
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.

Highlighted
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;

Highlighted
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,

];

Highlighted
Partner
Partner

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.

Highlighted
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.