4 Replies Latest reply: May 8, 2013 5:38 PM by Naim BENZ RSS

    Fonctions Qlikview

    Naim BENZ

      Bonjour

      Je suis débutant sur Qlikview, et je fais une autoformation sur ce dernier, Je voulais de m’expliquer l’utilité de quelque fonctions que j’ai trouvé dans ce script :

       

       

      LETvarMinDate=Num (Peek('OrderDate',0,'Orders')); (1) Pourquoi Num ?)
      LETvarMaxDate=Num (Peek('OrderDate',-1,'Orders'));
      LETvarToday=Num (Today());


      DateField:
      LOAD
      $(varMinDate)+ RowNo()-1 as num, (2)Je voulais une explication de cette ligne surtous Pourquoi+ RowNo()-1)
      date($(varMinDate)+RowNo()-1) as TempDate      (3)Idem)  
      AutoGenerate
      $(varMaxDate)-$(varMinDate)+1;  à  (4) Idem)  

      MasterCalendar:
      LOAD
      TempDateasOrderDate,
      Week(TempDate)asweek,
      Year(TempDate)asyear,
      Month(TempDate) asmonth,
      day(TempDate) asDay,
      WeekDay(TempDate) asweekday,
      InYearToDate(TempDate, $(varToday),0)*-1 asCurYTDFlag,    (5)Idem)
      InYearToDate(TempDate, $(varToday),-1)*-1 asLastYTDFlag
      Resident DateField
      OrderByTempDateAsc;

       

      Merci

        • Re: Fonctions Qlikview
          Eddy Sanchez

          1- Obtain the numeric value of OderDate for the first line (line 0) of the table Orders.

          obs: numeric value of a date is the number of days that past since 1/1/1900.

          obs: line -1 is the last line of the table.

           

          2- Obtain the numeric value of the first OrderDate plus line number of the Autogenerate table

          obs: The Autogenerate table (DateField) will have the number of days between max OrderDate and min OrderDate

           

          3- The Date of this number

           

          4- number of days between max OrderDate and min OrderDate

           

          5- InYeartoDate function with the third parameter: 0, is a boolean that return if those dates are in the same year.

          obs: after the fuction use * -1 because for the fuction true : -1 and false : 0

          obs: if the third parameter is -1 compare with the last year of the second date