4 Replies Latest reply: May 26, 2015 12:47 AM by sujeet Singh

# can any one explain this function?

hi,

I want create master calender in qlikview .I write function like this letvmindate=num(peek('orderdate',0,'produt'))

letvmaxdate=num(peek('orderdate',-1,'product'))
and  I  do not understand below this function.pls can anyone explain below function

date(\$(varMinDate) + rowno() – 1) As TempDate

Autogenerate

\$(varMaxDate) – \$(varMinDate) + 1;

Thankyou,

Regards

• ###### Re: can any one explain this function?

Hi

date(\$(varMinDate) + rowno() – 1) As TempDate

Autogenerate

\$(varMaxDate) – \$(varMinDate) + 1;

It generate the dates from Min Date to Max Date.

• ###### Re: can any one explain this function?

Hi,

date(\$(varMinDate) + rowno() – 1) As TempDate

Autogenerate

\$(varMaxDate) – \$(varMinDate) + 1;

TempDate column will create a sequence dates from minimum date i.e(varMinDate) to maximum date i.e(varMaxDate).

Ex : Consider varMinDate 1021 (i.e 21May2015) and varMaxDate 1030 i.e(30May2015), now the above code looks like below :

firstloop:

date(1021 + 1 - 1) as TempDate

Autogenerate

1030 - 1021 +1;

Output for TempDate = 21May2015

secondloop:

date(1021 + 2 - 1) as TempDate

Autogenerate

1030 - 1021 +1;

Output for TempDate = 22May2015

...

...

...

Tenthloop:

date(1021 + 10 - 1) as TempDate

Autogenerate

1030 - 1021 +1;

Output for TempDate = 30May2015

1030 - 1021 +1  = 10, so the loop runs only for 10 times

I hope this example gives you some idea.

Regards,

Satish.

• ###### Re: can any one explain this function?

thankyou satish.i understand but date(1021 + 1 - 1) as TempDate.in this example. the 1021 adds +1=1022 -1=1021 is this process.or what is +1 and -1  explain pls satish.

regards