hi,
I have the following logic that needs to be implemented at universe level
the filter for timesheet data should be based on timesheetperiod_full.enddate so IF timesheetperiod_full.enddate >30/6/2012(begning of financial year) THEN (if day of week > wednesday then timesheetperiod_full.enddate set to WEDNESDAY of current week) else timesheetperiod_full.enddate IN (previous week which will be "Friday")).
I have created a logic to check the day from currentdate and then deduct no.of days accordingly to either set to WEDNESDAY(current week) or FRIDAY(of last week) ONLY.
Select CASE DATEPART(DW, GETDATE())
WHEN 1 THEN DATENAME(DW, DATEADD(DAY, -4, GETDATE()))
WHEN 2 THEN DATENAME(DW, DATEADD(DAY, -3, GETDATE()))
WHEN 3 THEN DATENAME(DW, DATEADD(DAY, -4, GETDATE()))
WHEN 4 THEN DATENAME(DW, DATEADD(DAY, -5, GETDATE()))
WHEN 5 THEN DATENAME(DW, DATEADD(DAY, -1, GETDATE()))
WHEN 6 THEN DATENAME(DW, DATEADD(DAY, -2, GETDATE()))
WHEN 7 THEN DATENAME(DW, DATEADD(DAY, -3, GETDATE()))
END
How can I use the above logic to incorporate in what I am asking above.
I need this DIM to act as a FILTER for the record selection to be based on.
Using SQL / IDT 4.0
I have the following logic that needs to be implemented at universe level
the filter for timesheet data should be based on timesheetperiod_full.enddate so IF timesheetperiod_full.enddate >30/6/2012(begning of financial year) THEN (if day of week > wednesday then timesheetperiod_full.enddate set to WEDNESDAY of current week) else timesheetperiod_full.enddate IN (previous week which will be "Friday")).
I have created a logic to check the day from currentdate and then deduct no.of days accordingly to either set to WEDNESDAY(current week) or FRIDAY(of last week) ONLY.
Select CASE DATEPART(DW, GETDATE())
WHEN 1 THEN DATENAME(DW, DATEADD(DAY, -4, GETDATE()))
WHEN 2 THEN DATENAME(DW, DATEADD(DAY, -3, GETDATE()))
WHEN 3 THEN DATENAME(DW, DATEADD(DAY, -4, GETDATE()))
WHEN 4 THEN DATENAME(DW, DATEADD(DAY, -5, GETDATE()))
WHEN 5 THEN DATENAME(DW, DATEADD(DAY, -1, GETDATE()))
WHEN 6 THEN DATENAME(DW, DATEADD(DAY, -2, GETDATE()))
WHEN 7 THEN DATENAME(DW, DATEADD(DAY, -3, GETDATE()))
END
How can I use the above logic to incorporate in what I am asking above.
I need this DIM to act as a FILTER for the record selection to be based on.
Using SQL / IDT 4.0