Discussion Board for collaboration on QlikView Scripting.
I need to load the following file.
IDs are unique product but the customer name is displayed only once. How should the load script ?
thank you very much to all the community QV
Ready found a way , I leave in case someone needs
If ( len ( FieldName) > 0 , FieldName, Peek ( ' NEW' , - 1) ) as NEW,
do you want to replace the blanks partner_id with the last not blank partner_id?
if yes you can use a resident load with peek
if not post some data and the result you want to get
Make sure you sort it in correct manner (using Order By) so that the output you get is what you wanted.
This is my example and it works:
AAA: LOAD * Inline [ Order, Partner 1,a 3, 11, 5,b 7, 2,c 9,d 4, ]; Do BBB: Load Count(Order) as tot_without_value Resident AAA Where IsNull(Partner) or Trim(Partner)=''; Let vTot = Peek('tot_without_value', 0, 'BBB'); Let vTot = If(RangeSum('$(vTot)',0)=0, 0, $(vTot)); DROP Table BBB; If $(vTot) > 0 then CCC: NoConcatenate LOAD Order, If(IsNull(Partner) or Trim(Partner)='', Previous(Partner), Partner) as Partner Resident AAA; DROP Table AAA; AAA: NoConcatenate LOAD * Resident CCC; DROP Table CCC; ENDIF LOOP while $(vTot) > 0
Close the discussion by marking your own answer as correct. Otherwise other community members looking for a similar solution won't find your example. Thanks
You need to use PEEK function to look back where partner_id is NULL or LEN = 0 to return last populated partner_id.