Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a requirement,
There are common calendar dates, but on weekends (saturday and sunday) data will not be there but we need the data with those dates and with friday date
values.
is there any possibility with for loop or do while ? or is there any mechanisim with peek or previous? Please find the attachment as input and output with yellow colour.
Regards,
Ravi.
Hi Ravi,
Check the attachment for solution.
Data:
LOAD
Date,
Value,
WeekDay(Date) AS WeekDay;
LOAD * INLINE [
Date, Value
3/1/2012, 5
3/2/2012, 6
3/5/2012, 9
3/6/2012, 10
3/7/2012, 11
3/8/2012, 14
3/9/2012, 12
3/12/2012, 16
3/13/2012, 17
3/14/2012, 18
3/15/2012, 19
];
//Concatenating Saturday Records
Concatenate
LOAD
Date(Date + 1) AS Date,
Value,
WeekDay(Date + 1) AS WeekDay
RESIDENT Data
WHERE WeekDay = 'Fri';
//Concatenating Sunday Records
Concatenate
LOAD
Date(Date + 2) AS Date,
Value,
WeekDay(Date + 2) AS WeekDay
RESIDENT Data
WHERE WeekDay = 'Fri';
Regards,
Jagan.
Hi Jagan,
Sorry for late reply, But this script does not meet my requirement because i can't say friday in where cluase, one more thing is new, if there was/is a holiday in weekdays (But i did n;t mentioned this condition in my above post) but gererally i explained. If you have any more ideas please share on it.
Regards,
Ravi K.
Dear Ravi ,
Find the Attachment Wether it Solves ur issue
Hi Sachin,
Thanks for your effort on it, but i feel i need to change the script unless it does not give exact output as i expect in excel. i will let u know once i apply changes on it.
Regards,
Ravi.