Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

copy records of one row to all other rows based on ID

Hello community,

I have the following DB-table:

table.PNG

What I want to achieve is to copy the records of row no. 1 for the columns customer, project, plant where sheetname = "sheet 1" based on ID.

I don't want to insert the records to the DB, all I want is to get rid of the null values and get the rigtht output (not just row 1) when I select a certain customer for example.

Is this something I can do with a qlikview script (if yes - how?) or do I have to go the SQL way?

thank you.

2 Replies
marcus_sommer
Not applicable

Re: copy records of one row to all other rows based on ID

If ID is sorted you could use peek() for this in load:

db:

Load

     ID,

     Row,

     if(isnull(customer), peek('customer', - 1), customer) as customer,

     .....

- Marcus

Not applicable

Re: copy records of one row to all other rows based on ID

AFTER LOADED TABLE IN SCRIPT-

LOAD *

RSIDENT tablename

where Row=1;

***************************

or write this

LOAD *

RSIDENT tablename

where  match(Row,'1');