Modelling Time Dimension with Fact Table containing Start Date and End Date
Hi Gurus,
I have a time dimension with Year till Date. I have a fact table which consists of Start Date, End Date, Person ID, Department ID.
How do i design Time dimension with fact table the below scenario
In the dashboard i have start Month and End month as prompts.
In the report i need to display Count(Person ID) > Start Date and < End Date along the trend.
For instance, i have selected Jan-2009 as start date and Apr-2009 as End Date, then i need to display Count(Person ID) of Jan-2009, Feb2009, Mar-2009 andApr-2009.
I Can not connect Time dimension with only Start Date or only with End Date to get the trend along the months.
Please advice on the issue which i am having.
Hi,
Thanks for the response, Infact i tried using Complex join in physical layer. I have considered Time table joined with Fact table, and used >= and took and alias of the Time table and joined fact table using <=. When coming to BMM, i am not knowing how do i design this as if i merge the both the time dimensiona and its alias into single table, values will not be correct and if i make them as seperate columns. i can not show the trend as both are different columns.
Can you please let know where i am going wrong.
Thanks
Similar Messages
-
How to get starting date and ending date of the given Fiscal Period
Hi Friends,
In my Selection screen parameter, I've Fiscal year and Period , I want to get the starting date and ending date with the Fiscal period.
How to get and throught which FM.
Pls advise.
thanks®ards
Sankar.Hello Sankar,
Check the FM PERIOD_DAY_DETERMINE.
DATA :
l_periv TYPE periv,
l_blart TYPE blart,
l_fday TYPE bkpf-budat, "First day in period
l_lday TYPE bkpf-budat. "Last day in period
* Fetch the fiscal year variant from T001
SELECT SINGLE periv INTO TABLE l_periv
FROM t001
WHERE bukrs EQ p_bukrs.
* Get first day/last day
CALL FUNCTION 'PERIOD_DAY_DETERMINE'
EXPORTING
i_gjahr = p_gjahr
i_monat = p_monat
i_periv = l_periv
IMPORTING
e_fday = l_fday
e_lday = l_lday
EXCEPTIONS
error_period = 1
error_period_version = 2
firstday_not_defined = 3
period_not_defined = 4
year_invalid = 5
OTHERS = 6.
Hope this helps.
BR,
Suhas
Edited by: Suhas Saha on Jan 9, 2009 2:08 PM -
Search on basis of start date and end date
Hi,
I have added two fields 'Start Date' and 'End Date' on a search page.
I have done the VO extension also.
Now, I have to implement search logic to get all the records created in between 'Start Date' and 'End Date' after pressing the 'GO' button on that page.
Can anyone please provide guidance to extend the controller.
Thanks in advance.
Gaurav.Hi Anil,
Thanks for ur reply.
As per the link, I have written following code in the controller :
package oracle.apps.irc.vacancy.webui;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.table.OAAdvancedTableBean;
public class xxVacancyCriteriaCO extends VacancyCriteriaCO
public xxVacancyCriteriaCO() {}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
// Pressing the Go button causes the search to be executed.
OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
OAViewObject oaviewobject = (OAViewObject)am.findViewObject("XXIrcVacancySearchCriteriaVO");
if (pageContext.getParameter("Go") != null)
String created = pageContext.getParameter("ViewDate");
oaviewobject.setWhereClauseParam(0, created);
oaviewobject.executeQuery();
OAAdvancedTableBean table = (OAAdvancedTableBean)webBean.findChildRecursive("ResultsTable");
table.queryData(pageContext, false);
But while compiling it, I am getting the error as :
"Error(14,42): PerTransactionTopCOImpl not found in class oracle.apps.irc.common.webui.IrcOAControllerImpl in class oracle.apps.irc.vacancy.webui.VacancyCriteriaCO in class oracle.apps.irc.vacancy.webui.xxVacancyCriteriaCO"
Can u please suggest where the mistake is?
Thanks again.
Gaurav.
Edited by: Gaurav on Jan 14, 2011 12:51 AM -
Org.Assignment Infotype start date and End date is getting wrong.
Hi, When i create a new employee in PA40, in Org. Assignment infotype start date and end date is getting wrong. for eg. When i create an employee on 01.04.2014. In org. assignment infotype its getting like this. 01.01.2014 to 31.03.9999 and 01.04.9999 to 31.12.9999 Two date entries are creating by default.
Hi
Check in the Table - T588Z : Dynamic Actions ,is there any custom routines causing the defaulting dates functionality.
Thanks,
Sreeram -
How to create start date and end date
Hi guys
Need to create start date and end date as prompt in webi report.... how could it be possible please help me ...
regards@Universe:
Go to Condition/Filter:
Definition: Date=@Prompt("Select Start Date",D,,mono/multi,free/constrained,...)
OR @Select(Class\Object Date)=@Prompt("Select Start Date",D,,mono/multi,free/constrained,...)
Parse it & Apply OK.
Class/Object : If you have already object Date in any class already, use them.
Follow the same for End date also.
For both filters/prompts, check Apply on Universe
@Report/Query:
Drag [Date] object to Query filters section and in Operand say Prompt. Change text as Select Start Date & again drag [Date], this time say Select End Date.
Hope it helps you alot.
Gracias...!! -
How to display absence start date and end date in workflow notification?
Hi,
I would like to display the absence start date and end date at
1) Subject of workflow email notification/worklist notification OR/AND
2) Content of workflow email notification/worklist notification.
Appreciate if anyone can advise on this as this information is very crucial to our client.
Thank you.
Regards,
Shiau Chin, Teo1) Subject of workflow email notification/worklist notification OR/ANDyou have to customize the subject of notification message. You can find the message using following query.
SELECT message_type, message_name
FROM wf_notifications notif
where notification_id = <your notification>;> 2) Content of workflow email notification/worklist notification.
its already there I think. -
Function module to find start date and end date of fiscal year for company
Hi,
Is there any function module exist which will provide me start date and end date of fiscal year for company code and fiscal year provided?
Thanks & Regards,
ParagHi,
please check this link
it would be very useful
http://www.sapdevelopment.co.uk/fmodules/fms_fiscalyr.htm
Thanks and regards
durga.K -
Updating start date and end date at header level for a contract
As per the requirement I have to create a contract and assign the start date and end date to the contract.
I am using BAPI_CONTRACT_CREATEFROMDATA for creating a contract. I am assigning value for start date and end date for header data of contract in fields
-CT_VALID_F and CT_VALID_T of CONTRACT_HEADER_IN import parameter and also setting the corresponding indicator in CONTRACT_HEADER_INX parameter.
The BAPI executes successfully and does not return any error but when I check the start date and end date for contract in va43 the values are not assigned.
I also want to update the start date and end date for contract in other case for which I am using BAPI_CUSTOMERCONTRACT_CHANGE and passing date values to the same fields as those create but it give me an error while executing. The error is as follows:
Field 'GUEEN' cannot be changed, VBAKKOM 2000000162 ready for input.
Can anyone suggest what can be done for update the date values?
Thanks in advance.
KomalSo are we... The BAPI BAPI_CONTRACT_CREATE has the following importing parameters:
HEADER TYPE BAPIMEOUTHEADER
HEADERX TYPE BAPIMEOUTHEADERX
VENDOR_ADDRESS TYPE BAPIMEOUTADDRVENDOR
TESTRUN TYPE BAPIFLAG-BAPIFLAG
TECHNICAL_DATA TYPE BAPIMEOUTTECH
Change the HEADER and HEADERX parameters as I have indicated in my first post.
Regards,
John. -
BIAPPS how can we manually set both ETL start date and end date?
Dears experts,
how can we manually set both ETL start date and end date while conducting incremental load IN DAC?
Please advise me.
thanks,
Joe.You can set those dates in the DAC system parameters tab. You should see lots of $$xxxxxx parameters.
If I may, I'd suggest you use the OBI Applications forum for questions on DAC.
Antonio
BExpert, Brazil -
Function Module for calculating NEXT MONTH's start date and End date
Hi Friends,
I want a function module which could calculate the next months start date and end date...
Say my input will be like 01.01.2006(start date) it should return
01.02.2006 and 28.02.2006...
IS there any FM for this ... or how to go about this scenario ???
thanks in advance
Cheers,
R.KripaHi kripa,
1. There is no DIRECT Way.
2. We have to do in 2 steps.
3. See this code (just copy paste in new program)
U can use its FORM anywhere in your program,
for getting the desired dates.
4.
REPORT abc.
DATA : sdate TYPE sy-datum,
edate TYPE sy-datum.
PARAMETERS : dt TYPE sy-datum DEFAULT sy-datum.
PERFORM getdt USING dt sdate edate.
WRITE :/ sdate , edate.
INDEPENDENT FORM
FORM getdt USING orgdate stdate enddate.
DATA : mydate TYPE sy-datum.
CALL FUNCTION 'HR_PSD_DATES_ADD_MONTHS'
EXPORTING
v_date = orgdate
V_MONTHS = 1
IMPORTING
E_DATE = mydate
EXCEPTIONS
NOT_POSITIVE = 1
OTHERS = 2
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = mydate
IMPORTING
ev_month_begin_date = stdate
ev_month_end_date = enddate.
ENDFORM. "getdt
regards,
amit m. -
Query with Start Date and End Date
Dear Members,
I have done a basic query on to get a report on Sales Invoices processed in a given period with the General Ledger account they were posted to. Minor hassle is that to change the dates, I have to go into the script (see extract below) and change dates manually, save query etc.
Is there a way to have the query, when selected to run, pop up with window, allowing user to input say "start date" and "finish date". I imagine it will require some complex addition to the script below, any assistance will be appreciated.
Regards
Raj
SELECT T1.[DocNum] AS 'Document Number', T1.[DocDate] AS 'Posting Date', T0.[AcctCode] AS 'Account Code', T0.[Dscription] AS 'Item/Service Description', T0.[LineTotal] AS 'Row Total' FROM [dbo].[INV1] T0 INNER JOIN [dbo].[OINV] T1 ON T1.[DocEntry] = T0.[DocEntry] WHERE T1.[DocDate] > (CONVERT(DATETIME, '20110801', 112) ) AND T1.[DocDate] < (CONVERT(DATETIME, '20110831', 112) )Hi Raj,
try this:
/*SELECT FROM [dbo].[OINV] T0*/
declare @StartDate as datetime
/* WHERE */
set @StartDate = /* T0.DocDate */ '[%0]'
/*SELECT FROM [dbo].[OINV] T1*/
declare @EndDate as datetime
/* WHERE */
set @EndDate = /* T0.DocDate */ '[%1]'
SELECT T1.DocNum AS 'Document Number', T1.DocDate AS 'Posting Date', T0.AcctCode AS 'Account Code', T0.Dscription AS 'Item/Service Description', T0.LineTotal AS 'Row Total'
FROM dbo.INV1 T0 INNER JOIN dbo.OINV T1 ON T1.DocEntry = T0.DocEntry WHERE T1.DocDate > @StartDate AND T1.DocDate < @EndDate
Thanks,
Neetu -
Calculate duration between start date and end date
Hi everyone,
I'm facing with problem when calculating duration between start & end with this function below . This fuction is working well, but i want to change working time from 8:00 am to 17:30 pm instead of 17:00 , and lunch time from 12:00 to 13:30 instead
of 13:00 as present . Problem is , i changed data type of start hour and end hour from INT to decimal . But it is still wrong .
Pls help me . It's very urgent bcoz i need it for monthly report .
Many thanks .
Here is function which im using :
ALTER Function [dbo].[GetWorkingMin](@pStartDate DateTime, @pEndDate DateTime) Returns Int
AS
Begin
Declare @StartDate DateTime = @pStartDate
Declare @EndDate DateTime = @pEndDate
Declare @WorkMin int = 0 -- Initialize counter
Declare @Reverse bit -- Flag to hold if direction is reverse
Declare @StartWorkingHour int = 8 -- Start of business hours (can be supplied as an argument if needed)
Declare @EndWorkingHour int = 17 -- End of business hours (can be supplied as an argument if needed)
Declare @Holidays Table (HDate DateTime) -- Table variable to hold holidayes
Declare @LunchHour int = 12
Declare @StartHour int = DatePart(HH, @StartDate)
Declare @EndHour int = DatePart(HH, @EndDate)
-- If dates are in reverse order, switch them and set flag
If @StartDate>@EndDate
Begin
Declare @TempDate DateTime=@StartDate
Set @StartDate=@EndDate
Set @EndDate=@TempDate
Set @Reverse=1
End
Else Set @Reverse = 0
-- Get country holidays from table based on the country code
Insert Into @Holidays (HDate) Select HDate from HOLIDAY Where HDATE>=DateAdd(dd, DateDiff(dd,0,@StartDate), 0)
If DatePart(HH, @StartDate)<@StartWorkingHour
begin
Set @StartDate = DateAdd(hour, @StartWorkingHour, DateDiff(DAY, 0, @StartDate))
-- If Start time is less than start hour, set it to start hour
Set @StartHour = DatePart(HH, @StartDate)
end
If DatePart(HH, @StartDate)>=@EndWorkingHour
begin
Set @StartDate = DateAdd(hour, @StartWorkingHour+24, DateDiff(DAY, 0, @StartDate))
-- If Start time is after end hour, set it to start hour of next day
Set @StartHour = DatePart(HH, @StartDate)
--return DatePart(day, @StartDate)
end
If DatePart(HH, @EndDate)>=@EndWorkingHour
begin
Set @EndDate = DateAdd(hour, @EndWorkingHour, DateDiff(DAY, 0, @EndDate))
-- If End time is after end hour, set it to end hour
Set @EndHour = DatePart(HH, @EndDate)
end
If DatePart(HH, @EndDate)<@StartWorkingHour
begin
Set @EndDate = DateAdd(hour, @EndWorkingHour-24, DateDiff(DAY, 0, @EndDate))
-- If End time is before start hour, set it to end hour of previous day
Set @EndHour = DatePart(HH, @EndDate)
end
If (@StartHour>=@LunchHour and @StartHour < (@LunchHour +1))
Begin
Set @StartDate = DateAdd(hour, @LunchHour + 1, DateDiff(DAY, 0, @StartDate))
-- If Start time is in lunch time, set it to 12
Set @StartHour = @LunchHour + 1
End
If (@StartHour>=@LunchHour and DatePart(DW, @StartDate) = 7)
Begin
Set @StartDate = DateAdd(hour, @StartWorkingHour + 24, DateDiff(DAY, 0, @StartDate))
Set @StartHour = DatePart(HH, @StartDate)
End
If (@EndHour>=@LunchHour and @EndHour < (@LunchHour +1))
Begin
Set @EndDate = DateAdd(hour, @LunchHour +1, DateDiff(DAY, 0, @EndDate))
-- If End time is in lunch time, set it to 13
Set @EndHour = @LunchHour + 1
End
If (DatePart(DW, @EndDate) = 7 and DatePart(HH, @EndDate) >= @LunchHour) Set @EndDate = DateAdd(hour, @LunchHour, DateDiff(DAY, 0, @EndDate)) -- If End day is Saturday and End time is after end hour, set it to end hour of saturday
If @StartDate>@EndDate Return 0
-- If Start and End is on same day
If DateDiff(Day,@StartDate,@EndDate) <= 0
Begin
If (Datepart(dw,@StartDate)>1 And DATEPART(dw,@StartDate)<7)
-- If day is between sunday and saturday
If (Select Count(*) From @Holidays Where HDATE=DateAdd(dd, DateDiff(dd,0,@StartDate), 0)) = 0
-- If day is not a holiday
If @EndDate<@StartDate Return 0 Else
Begin
Set @WorkMin=DATEDIFF(MI, @StartDate, @EndDate)
-- Calculate difference
If (@StartHour <= @LunchHour and @EndHour >= @LunchHour + 1)
Set @WorkMin = @WorkMin - 60;
End
Else Return 0
Else Begin
if (DATEPART(dw,@StartDate)=7) set @WorkMin = @WorkMin + DATEDIFF(MI, @StartDate, @EndDate);
Return @WorkMin
End
End
Else Begin
Declare @Partial int=1
-- Set partial day flag
While DateDiff(Day,@StartDate,@EndDate) > 0
-- While start and end days are different
Begin
If Datepart(dw,@StartDate)>1 And DATEPART(dw,@StartDate)<7 -- If this is a weekday
Begin
If (Select Count(*) From @Holidays Where HDATE=DateAdd(dd, DateDiff(dd,0,@StartDate), 0)) = 0 -- If this is not a holiday
Begin
If @Partial=1
-- If this is the first iteration, calculate partial time
Begin
Set @WorkMin=@WorkMin + DATEDIFF(MI, @StartDate, DateAdd(hour, @EndWorkingHour, DateDiff(DAY, 0, @StartDate)))
If (@StartHour <= @LunchHour) Set @WorkMin = @WorkMin - 60;
Set @StartDate=DateAdd(hour, @StartWorkingHour+24, DateDiff(DAY, 0, @StartDate))
Set @Partial=0
End
Else Begin
-- If this is a full day, add full minutes
Set @WorkMin=@WorkMin + (@EndWorkingHour-@StartWorkingHour - 1)*60
Set @StartDate = DATEADD(DD,1,@StartDate)
End
End
Else Set @StartDate = DATEADD(DD,1,@StartDate)
End
Else Begin
If (DATEPART(dw,@StartDate)=7)
Begin
Set @WorkMin = @WorkMin + DATEDIFF(MI, @StartDate, DateAdd(hour, @LunchHour, DateDiff(DAY,
0, @StartDate)));
End
--Set @StartDate = DATEADD(DD,1,@StartDate)
Set @StartDate = DateAdd(hour, @StartWorkingHour + 24, DateDiff(DAY, 0, @StartDate))
Set @StartHour = DatePart(HH, @StartDate)
End
End
If Datepart(dw,@StartDate)>1 And DATEPART(dw,@StartDate)<7
-- If last day is a weekday
If (Select Count(*) From @Holidays Where HDATE=DateAdd(dd, DateDiff(dd,0,@StartDate), 0)) = 0
-- And it is not a holiday
Begin
If @Partial=0 Set @WorkMin=@WorkMin + DATEDIFF(MI, @StartDate, @EndDate) Else
Set @WorkMin=@WorkMin + DATEDIFF(MI, DateAdd(hour, @StartWorkingHour, DateDiff(DAY, 0, @StartDate)), @EndDate)
If (@EndHour >= (@LunchHour + 1)) Set @WorkMin = @WorkMin - 60;
End
If (DATEPART(dw,@EndDate)=7)
Begin
Set @WorkMin = @WorkMin + DATEDIFF(MI, DateAdd(hour, @StartWorkingHour, DateDiff(DAY, 0, @EndDate)),@EndDate);
End
End
If @Reverse=1 Set @WorkMin=-@WorkMin
Return @WorkMin
EndThe problem is you cannot specify partial hours.
I think your best bet would be to alter the function sufficiently so it will accept times instead of hours, and where you're making comparisons to the hour, use dates/date functions instead.
Then, just set the variable as a full time (or datetime, if you need). -
How can I get the start date and end date of a certain week?
Hello, in my java code, I can get the week ID , using
org.joda.time.base.AbstractDateTime.getWeekOfWeekyear() , for example, this week is the 16th week of this year. And I want to get the start date(date of Monday) and end date(date of Sunday) of the week. Is there any method can supply such date value??thanks1 public Date getCurrentMonday(){
2 Date monday = null;
3 Calendar rightNow = Calendar.getInstance();
4 int day = rightNow.get(Calendar.DAY_OF_WEEK);
5 int distance = 0;
6
7
8 if (day == Calendar.MONDAY)
9 monday = rightNow.getTime();
10 else
11 {
12 distance = day - Calendar.MONDAY;
13 if (distance == -1)
14 distance = 6;
15
16 monday = (Date) (rightNow.getTime());
17 monday.setTime(monday.getTime() - 1000 *60 *60 *24 *(distance));
18 }
19 return monday;
20 } -
Scheduling start date and end dates
Hello Gurus,
I am trying to understand the schedule start date and schedule end date functionality in Plant Maintenance. I do understand the basic start and end dates. Currently I set up u201C3.Do not adjust basic dates, dep rqmts to order startu201D and set the scheduling type as u201CForwardsu201D . Please note we donu2019t do any capacity planning or leveling.
So my question is, why the scheduling start date is defaults to the basic start date for forwards and scheduling finish date defaults to basic finish date for backwards ? I tried adding couple of operations and save the work order. It did not change anything in schedule dates.
Do we really need to care about scheduling dates if we donu2019t use capacity planning ?
Please advise
MaheeHi,
As per priority, final dates would be calculated as we will define the duration based on the priprity. Either current date or basic date only applied to Scheduling start date.
You can change the scheduling start date so that based on priority, final date would be calculated.
Regards,
Maheswaran. -
How to get the current month starting date and ending date by default ?
Hello Creators,
This is my requirement, kindly do the needful, Please dont gimme any links i've no access for other sites, gimme the right solution.
My Requirement :
Creation Date (VBAK-ERDAT) - Select Option. By default, the program should run for the current Month ie between the starting and ending date of the current month when the program is run. Today the date is 18th using sy-datum we can bring the current date by calling it in the initialization event, but the requirement is it should not give me the current date, it should only give me the month starting date and the end date. Kindly help.
Thanks in advance ...DATA: gv_datum LIKE vbak-erdat.
SELECT-OPTIONS: so_date FOR gv_datum.
INITIALIZATION.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
ev_month_begin_date = so_date-low
ev_month_end_date = so_date-high.
so_date-option = 'BT'.
APPEND so_date.
START-OF-SELECTION.
Hope this solves the issue. Don't forget to be generous
Cheers,
Sougata.
Maybe you are looking for
-
I'm shooting an HDTV program that will use illustrations created by an artist using Adobe Illustrator CS 5. I'm using Adobe Premiere CS5 to edit, with HDTV settings of 1920 x 1080 pixels. I'm trying to determine what Adobe Ilustrator settings to ha
-
DVD.app and Sonica Theater no sound
Hello, I have a problem with the DVD.app and Sonica Theater USB 7.1 sound card. I get sound through the USB sound card with every application, Quicktime, VLC (while playing DVDs also), iTunes...but I cannot get sound through the USB card when using t
-
System Preferences hangs with Mountain Lion
Various parts of system preferences hang under Mountain Lion. Prior to upgrade there was no problem. Any ideas?
-
How do you open a file "not supported on this architecture"?
I downloaded an upgrade for my MiFi today. Installation went well until I tried to open the application. Then I received this notice: You can't open the application "DUU_Verizon_MiFi4510L_FW2.23" because it is not supported on this architecture.
-
Cross-domain AlwaysOn Availability Groups
I had a colleague of mine comment in a meeting that SQL Server 2014 supports cross-domain data synchronisation using AlwaysOn Availability Groups. I didn't contradict that immediately because, even though I thought it wasn't the case, I couldn't fin