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

# Fonctions Qlikview

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:
\$(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:
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

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

• ###### Re: Fonctions Qlikview

Merci beaucoup pour votre réponse, Par contre j'ai pas compris pourquoi RowNo()-1, et \$(varMaxDate)-\$(varMinDate)+1

• ###### Re: Fonctions Qlikview

Just because RowNo() begin in 1

and the first line

\$(varMinDate)+ RowNo()-1

will be \$(varMinDate)+1-1

And

\$(varMaxDate)-\$(varMinDate)+1

because between two number you have the difference plus 1

for example how many number do you have between 3 and 6

3,4,5,6

6-3+1=4

• ###### Re: Fonctions Qlikview

Merci beaucoup maintenant c'est très clair