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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gidon500
Creator II
Creator II

Add field during load

Hi guys

I have a problem to solve  !!

enclosed attached excel file trans

first column is name

second is new trans if y it is new

third id transnum

I need to add the forth column GroupNum ,

a group gets GroupNum , where newtran='y ' , GroupNum=TranNum

all lines that follow this line until the next 'y' with same Name ( not includes ) 

All Lines get the GroupNum from the line which  newtran = 'y'

the enclosed file expalin it better .

 

thanks

gidon

1 Solution

Accepted Solutions
Not applicable

Hi Gidon ,

Table1 :

load Rowno() as r ,

Name ,

Newtran,

Trannum ,

Trannum as Groupnum

from tran.xlsx

;

Tran :

load r,

Name ,

Newtran,

Trannum ,

if(Newtran = 'y' , Groupnum, peek(Groupnum) ) as Groupnum

resident  Table1 order by r ;

hope it helps..

Regards,

koti

View solution in original post

2 Replies
Not applicable

Hi Gidon ,

Table1 :

load Rowno() as r ,

Name ,

Newtran,

Trannum ,

Trannum as Groupnum

from tran.xlsx

;

Tran :

load r,

Name ,

Newtran,

Trannum ,

if(Newtran = 'y' , Groupnum, peek(Groupnum) ) as Groupnum

resident  Table1 order by r ;

hope it helps..

Regards,

koti

gidon500
Creator II
Creator II
Author

Hi Kotty

thanks for your prompt response

i made it work correctly

gidon