3 Replies Latest reply: Mar 21, 2014 10:47 AM by Nicole Smith RSS

    Peek Function

      Hi All,

       

      For the peek function to work, does my data have to be already sort, or can I build some sorting code into my load statement. I am having some difficulty with the following code, which is producing various Peek values for the same customer, where it should only be producing one value:

       

      [BALES LOOP]:

      LOAD //[Fieldworker Name],

           [Submission Id],

           //[Fieldworker Id],

           //[Repeats On Question],

           //[Repeat Question Value],

           //[Repeating Index],

           Date(Floor([Received Date]),'DD.MM.YYYY') as [Received Date],

           'V'& TIMB as TIMB,

           Bales as [Bales Loaded]

      FROM

      [C:\Users\Herbert\Documents\Consulting\Tribac\Qlikview\2014 Project\LT Bales.xlsx]

      (ooxml, embedded labels, table is [2 Bale Loop]);

       

      [BALE LOOP]:

      NoConcatenate LOAD

          //[Fieldworker Name],

          [Submission Id],

           //[Fieldworker Id],

           //[Repeats On Question],

           //[Repeat Question Value],

           //[Repeating Index],

           [Received Date],

           TIMB,

           if(previous(TIMB)=TIMB,peek([Received Date]),[Received Date])as [Last Pickup],

           [Bales Loaded]

          

          Resident [BALES LOOP]

          Order by TIMB,[Received Date];

          

          DROP Table [BALES LOOP];

       

      Can anyone assist.

       

      Thanks

       

      Herbert