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.

bill_markham
Not applicable

Does Previous & Peek make a load run slow ?

Hi

I have this load statement below

LOAD

  [Employee Environment Key] ,

///////////////// It is the line below which makes this load statement run slow

  if ( previous([SCD Employee RSMS BU]) = [SCD Employee RSMS BU], peek('SCD Counter'),rangesum(1,peek('SCD Counter'))) as [SCD Counter] ,

  [SCD Environment] ,

  [SCD Environment Employee Key] ,

  [SCD Employee Number] ,

  [SCD Employee Active] ,

  [SCD Date] ,

  [SCD Employee RSMS BU] , 

  [SCD EE Current RSMS BU] ,

  [SCD Leave Date]

resident Temp01

order by

  [SCD Environment Employee Key] ,

  [SCD Date] ,

  [SCD Employee RSMS BU]

;

When I comment out the if ( previous... line it runs about 5 times faster.

Is this what one would expect ?

If not, then any suggestions for improvement ?

Best Regards,     Bill

2 Replies
marcus_sommer
Not applicable

Re: Does Previous & Peek make a load run slow ?

Generally I would think it will be slower as without these functions but in this case it is the only transformation and hence it will prevent an optimize load. I use these functions by several loads over X million rows and the perfomance is ok. - rot really slower as without them, except it prevent an optimize load.

- Marcus

bill_markham
Not applicable

Re: Does Previous & Peek make a load run slow ?

Marcus

I too would expect it to be slower with the transformation line, but 5 times slower seems a bit excessive to me.

It is loading from resident, so by definition it will never be an optimised load.

Best Regards,     Bill