6 Replies Latest reply: Jan 22, 2016 11:48 AM by Sebastian Müller RSS

    Set Flag based on a value x days ago

    Sebastian Müller

      Hey everybody,

       

      the following is the initial situation. Every day QlikView is fetching new Data from a Database. The whole dataset in the QVW contains about 45.000.000 rows. So every day there will be added about 60.000 rows.

       

      What I want to do is the following: Based on a value 7 days ago or the actual day (when the script runs), I want to set a Flag in the new records. The table illustrates my problem, the green rows are the old data and the other rows are the records I'm adding to my dataset:

       

      DATEARTNRVALUEFLAG
      03.01.20161000
      10.01.20163333
      10.01.20161000WPWP
      10.01.20162000ZPZP
      17.01.20161000WP
      17.01.20162000ZP
      17.01.20163333WPWP

       

      So when I add new records I want QV to look 7 days back in the field 'VALUE' for the certain product and set a 'X' in the field 'FLAG', if the field 'VALUE' contains a 'WP' (yellow cells). Also I want so set a 'X' when there is just in the new record a 'WP' for the certain product (blue cells).

       

      I could use some kind of Lookup to get the the content of the field 'VALUE', but it's taking too much time at all.

      So do have any ideas how I could face that problem in an appropriate script runtime?

       

      Thanks a lot in advance:)

      Kind Regards

       

      Nachricht geändert: I've edited the table content for the field 'FLAG'.