Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Explain

Hi Expertise , 

Can someone please explain me what does the below script do exactly . I really dont understand this .

And why is the + symbol ? what is IterNO()-1 ?  

 

LOAD

Date(MinDate + IterNo() -1,'DD/MM/YYYY') as Date,
Date(MinDate + IterNo() -1,'YYYY') as Year,

Date(MinDate + IterNo() -1,'YY') & '_' & Num(Week(MinDate + IterNo() -1),'00') as Week

While
MinDate + IterNo() -1 <=MaxDate;

LOAD
min(Date) as MinDate,
max(Date) as MaxDate
Resident Event_TAble;

 

Thanks,

In Advance 

4 Replies
Anil_Babu_Samineni

Nothing, From this table "Event_TAble" It will generate Min and Max Dates.

Then, While loop running from Min to Max date whatever date/year/week fields will be generate missing dates from Iterno() as per dat from "Event_TAble" this table available.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
smilingjohn
Specialist
Specialist
Author

Thanks @Anil_Babu_Samineni 

That mean IterNo() is used to populate the missin dates ? whcy is there -1 in it ? 

And is this the only way to generate the missing dates or can we have master calender script  intead ?

What do you suggest whcy is reliable ?

Yes there is a table called  "Event_TAble" which has many fields including "Date field  (01-16-2020 00:00:00)"

 

Thanks

 

marcus_sommer

Iterno() starts with 1. If your min-date starts with 01/01/2020 and you adds 1 then would your calendar start with 01/02/2020 - means the 01/01/2020 would be missing. Therefore -1 to include the min-date.

- Marcus

Anil_Babu_Samineni

Yes, Iterno() can prevent the data as per records missing - I would love to have master calendar instead?

 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful