Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

madhu

Labels (1)
4 Replies
MayilVahanan
MVP
MVP

Hi

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

Autogenerate

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


It generate the dates from Min Date to Max Date.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

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.

Not applicable
Author

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

madhu



sujeetsingh
Master III
Master III

+1 is the increment in the value and -1 is the deduction. Hence the +1 is adding one day to the min date here.