Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Good Morning ,
Can any one plz explain me in detail what does the below script excatly means ? and how does it works .
LET vMinDate = num(MakeDate(2014, 1));
LET vMaxDate = num(MakeDate(2014, 1, 31));
LET vCount = 0;
Directory; //Current directory
//------------------- Temporary Calendar -------------------
TempCalendar:
LOAD
$(vMinDate)+IterNo()-1 AS Num,
Date($(vMinDate)+IterNo()-1,'DD.MM.YYYY') AS TempDate
AUTOGENERATE 1 WHILE ($(vMinDate)+IterNo()-1) <= $(vMaxDate);
//----------------------------------------------------------
//------------FOR loop to load the excel files in a sequence----------
FOR a = 0 to NoOfRows('TempCalendar')-1
LET vFilename = text(peek('TempDate',$(a),'TempCalendar'));
Thanks in Advance
Hi Wrestler,
Here is in detail.
LET vMinDate = num(MakeDate(2014, 1)); //creates a number representation for 1st Jan 2014 and assign number value for vMinDate as 41640
LET vMaxDate = num(MakeDate(2014, 1, 31));//creates a number representation for 31st dec 2014 and assign number value for vMaxDate as 42004
LET vCount = 0;
Directory; //Current directory
//------------------- Temporary Calendar -------------------
Below part generates calendar table for 2014 with first column as number representation of date and 2nd clolumn as date representation of 365 days of 2014.
TempCalendar:
LOAD
$(vMinDate)+IterNo()-1 AS Num,
Date($(vMinDate)+IterNo()-1,'DD.MM.YYYY') AS TempDate
AUTOGENERATE 1 WHILE ($(vMinDate)+IterNo()-1) <= $(vMaxDate);
//----------------------------------------------------------
//------------FOR loop to load the excel files in a sequence----------
this is just to create text representation of each date and assign the value of each date into VFileName varable. vFileName variable must be used as part of the file names to differentiate each file for every single date
FOR a = 0 to NoOfRows('TempCalendar')-1
LET vFilename = text(peek('TempDate',$(a),'TempCalendar'));
Hope this helps.
BR,
chinna
Hi Wrestler,
This is a script to create a master calendar between two dates ( MinDate and MaxDate).
in Vmindate we are storing date '1/1/2014' and in vMaxdate we are storing the date '1/31/2014'
after that using an iterno() function we are auto generating all the dates between the min and max date.
Hope it helps.
Regards
KC
MakeDate(2014, 1) will create date with given attributes like: 01/01/2014
MakeDate function will be used to create date
syntax: MakeDate(2014) if only year was given it will take 1st month of year and 1st date of month
hi
LET vMinDate = num(MakeDate(2014, 1));
it will assing vMinDate =2014/1/1
LET vMaxDate = num(MakeDate(2014, 1, 31))
it will assing vMaxDate =2014/1/31
TempCalendar:
LOAD
$(vMinDate)+IterNo()-1 AS Num,
Date($(vMinDate)+IterNo()-1,'DD.MM.YYYY') AS TempDate
AUTOGENERATE 1 WHILE ($(vMinDate)+IterNo()-1) <= $(vMaxDate);
This code will generate dates between 2014/1/1 and 2014/1/31
FOR a = 0 to NoOfRows('TempCalendar')-1
LET vFilename = text(peek('TempDate',$(a),'TempCalendar'));
This will now assign each date to vFilename.
I feel files names are given as date and for loop is used to load data from these files automatically through loop
Thanks and Regards,
Mangal
Hi Wrestler,
Here is in detail.
LET vMinDate = num(MakeDate(2014, 1)); //creates a number representation for 1st Jan 2014 and assign number value for vMinDate as 41640
LET vMaxDate = num(MakeDate(2014, 1, 31));//creates a number representation for 31st dec 2014 and assign number value for vMaxDate as 42004
LET vCount = 0;
Directory; //Current directory
//------------------- Temporary Calendar -------------------
Below part generates calendar table for 2014 with first column as number representation of date and 2nd clolumn as date representation of 365 days of 2014.
TempCalendar:
LOAD
$(vMinDate)+IterNo()-1 AS Num,
Date($(vMinDate)+IterNo()-1,'DD.MM.YYYY') AS TempDate
AUTOGENERATE 1 WHILE ($(vMinDate)+IterNo()-1) <= $(vMaxDate);
//----------------------------------------------------------
//------------FOR loop to load the excel files in a sequence----------
this is just to create text representation of each date and assign the value of each date into VFileName varable. vFileName variable must be used as part of the file names to differentiate each file for every single date
FOR a = 0 to NoOfRows('TempCalendar')-1
LET vFilename = text(peek('TempDate',$(a),'TempCalendar'));
Hope this helps.
BR,
chinna
hi Chinna,
Thanks for ur detail explanation , People like u should be there in IT to encourage Fresher ,thanks once again.
Good regards
Wrestler