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

How to repeat the first value into next rows?

Hi every body

I have one doubt in qlikview my data is like this

pol,item,prem

101,0,123

101,1,0

101,2,0

102,0,234

102,1,0

102,2,0

my O/P is

pol,item,prem

101,0,123

101,1,123

101,2,123

102,0,234

102,1,234

102,2,234

How can we develop the logic? One thing I want that logic as a Script Level as List Box, not for expression level?

1 Solution

Accepted Solutions
MayilVahanan

HI

Try like this

Table:

LOAD pol,

  item,

  if(pol = peek('pol') and prem = 0,peek('prem'),prem) as prem;

LOAD * INLINE [

    pol,item,prem

    101,0,123

    101,1,0

    101,2,20

    101,3,0

    102,0,234

    102,1,0

    102,2,0

];

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
jeffmartins
Partner - Creator II
Partner - Creator II

Hi Nirmal Raj,

You should use the peek() funtion to get the previous record read and compare it with the current record.

See the attached file for more details. Hope this helps you.

Regards

Not applicable
Author

there are two ways

by wizard--

how to fill  blank row?

go to ctrl E-->

then clik on table files

then clik on add table

then next

then clik on enable transformation steps

then clikon fill

clik fill

choose the target column

cell comdition

ok

ok

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

Alejandro_Hernández
Former Employee
Former Employee

see attached

MayilVahanan

HI

Try like this

Table:

LOAD pol,

  item,

  if(pol = peek('pol') and prem = 0,peek('prem'),prem) as prem;

LOAD * INLINE [

    pol,item,prem

    101,0,123

    101,1,0

    101,2,20

    101,3,0

    102,0,234

    102,1,0

    102,2,0

];

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.