0 Replies Latest reply: Aug 23, 2012 12:19 PM by Ben Reed RSS

    Special treament for duplicate records

    Ben Reed

      I am looking for some assistance in a complicated matter that I have been dealing with manually but would like automate through qlikview scripting.  I currently have a list of records that have part number and serial number and each part number and serial number may have multiple service types (OH or IN) with different due dates.  I would like to write my script such that it will pull in two records (OH and IN) for each part number and Serial Number when the difference between “TTO/I/R” for OH and IN is greater than 600.  If the difference between “ TTO/I/R” is less than 600 I would like to Force the “SVC_TYPE” to be OH at the DUE DATE  of the lesser TTO/I/R Value of the two. 

      I have pasted an example of the data and how the solution may play out below.  I am begging for your assistance on this major pain.

       

      Part NoSerial NoDescriptionSvc TypeTTO/I/RDue DateDuplicate ActionDue Date
      206-040-004-115A-141TRANSMISSIONIN1,395.01/20/2014Keep1/20/2014
      206-040-004-115A-141TRANSMISSIONOH3,645.05/2/2016Keep5/2/2016
      206-040-004-115A-144TRANSMISSIONIN1,026.09/5/2013Keep9/5/2013
      206-040-004-115A-144TRANSMISSIONOH3,276.012/17/2015Keep12/17/2015
      206-040-004-115A266TRANSMISSIONIN1,633.04/18/2014Remove
      206-040-004-115A266TRANSMISSIONOH1,650.04/24/2014Keep4/18/2014
      206-040-004-115A-279TRANSMISSIONIN396.011/25/2012Remove
      206-040-004-115A-279TRANSMISSIONOH402.011/26/2012Keep11/25/2012
      206-040-004-115A-298TRANSMISSIONIN1,361.01/5/2014Remove
      206-040-004-115A-298TRANSMISSIONOH1,381.01/12/2014Keep1/5/2014