9 Replies Latest reply: Feb 13, 2014 2:18 AM by Håkan Fogelin RSS

    Scripting with qvd:s

    Håkan Fogelin
      load * from I:\Statistics\QVA\Datafiles\2012\StatKomp2012_gen.qvd (qvd);
      load * from I:\Statisticsk\QVA\Datafiles\2013\StatKomp2013_gen.qvd (qvd);
      join load cunumber,Salesman1 as CR_Sales1,Salesman2 as CR_Sales2  resident Customer_read;
      This gives me both salesmen in every record but I will have only the one that correspod
      to the inoice type  in inv_type 
      In my earlier script where I was joining the salesman in an temptable 
      Load [@1:8T] as inv_period1,
      from I:\Statistics\QVA\Datafiles\2012\stat12_gen.txt (ansi, fix, no labels, header is 0, record is line)
       where [@216:223T]<>'GE';
       join load cunumber,Salesman1,Salesman2 resident Customer_read;
       and in the next read I had an if-sentence
      Load inv_period1 as inv_period,
      inv_type1 as inv_type,
      if(inv_type1='L',Salesman1,Salesman2) as inv_salesman
      resident Fakturor_Temp
        where left(StatHierarki1,2)<>'17' ;
        This inv_salesman was then used in an Load * Inline
        Load * Inline [
        inv_salesman, salesman
        SE999900, No allocation
        SE999901, RegionA_G
        SE999902, RegionB_G
        SE999903, RegionB_F
        SE999904, RegionC_G
        SE999905, No allocation
        SE999906, RegionC_F
        '        ', No allocation
      When I load the qvd-files I have no connection to the field inv_type as I have when I load
      from the txt-file. 
      Is there any other way to put the right salesman to the record in the table Invoices?