Display data for last working day of month
Hi
I am trying to chart values for the last six years but only to plot the value for the last working day of the month, except for the current month where I am taking an average of the month so far. Everything I've tried has so far failed spectacularly. Has anyone resolved a similar problem?
If I understand your dilemma correctly, you may want to create a cross-tab and then create the chart off of the cross-tab. Is the data in your tables that you want to chart on something like this:
4/30 5/30 6/30 7/31 8/29 Sept.
Row 1 20 30 10 25 20 (avg for month)
Row 2 5 10 8 15 15 (avg for month)
etc.
If so, 1) can you show an example of the data and 2) what kind of chart do you want to create?
Similar Messages
-
Function module for getting teh last working day of a month.
Hi GURUS,
this is criteria,please help me
if V_T001B- FRYE1 < month entered in selection screen
Then throw the error message
Else
Find the previous period and its last working day from the function module
(i..e Assume entered date as June 2 2009 then
Period 6 -1 = 5.
Pass the month 05 to function module then
Find last working day.
Keep it in a variable (V_LAST_PRD_WRKDAY)
Proceed further.
thanks in advance,
RajeevHi Rajeev,
You can use Function Module LAST_DAY_IN_PERIOD_GET.
Ex:
CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = p_gjahr
i_periv = lwa_t009b-periv
i_poper = lwa_t009b-poper
IMPORTING
e_date = s_audat-high.
Regards,
Ravi K -
How to create a recurrent event on the first or last work day of the month
The lightning calendar allows selection of the first and last day of the month for recurrent events but for business I need to use the first and last WORK day of the month (Monday - Friday) to schedule particular tasks. In the calendar preferences under 'View' I can select the days that make up the work week but this does not transfer to an option in recurrent events. Is there another way to do this or is it just not available?
Hi there,
do know for the UlltimateBootCD4Win? This from CD bootable WinXP-BartPEedition with additional tools gives you the ability to make such things like partitioning, backup or formatting your HDD.
It has many more applications which help you to maintain your system without booting your original OS.
So I think that this CD will solve your partitioning issues.
Heres a link: www.ubcd4win.com/
Just try it and tell me your opinion.
Nice weekend and greetings from the sunny south ;) -
my phone was not worked for last two days it happen after the instalation of new os,this is happen one of my friiends also plssssss find some solution
We are all just phone users here, and no-one can hope to provide any advice with so little information to go on as to what exactly has happened. You need to provide some detail.
-
Hi All,
I have a simple query which is below:-
Declare @reportdate date
set @reportdate= (DATEADD(dd,-5,getdate()))
select * from dbo.Table
where date IN (@reportdate)
I need this query to pull the data for the last 3rd business day .So lets say today is monday then i need the data for last week wednesday which is 3 business days back from monday, if today is a tuesday it would be for last thursday ( as 3 business days for
tuesday would be thursday). But if today is wednesday then i need to be last 3rd business day which is last friday and i also need to get the data for saturday and sunday.
Can someone please help me how cani change my filter to do this?
Please let me know if i am still unclear.
ThanksHi SqlDev12,
Based on my understanding on your requirement, you can reference the below sample.
CREATE TABLE BusinessTable
Bdate DATE,
Wd VARCHAR(10)
;WITH Cte(DT,WD) AS
SELECT CAST('20150401' AS DATE),DATENAME(WEEKDAY,CAST('20150401' AS DATE))
UNION ALL
SELECT DATEADD(DAY,1,DT),DATENAME(WEEKDAY,DATEADD(DAY,1,DT)) FROM Cte
WHERE DT<GETDATE()
INSERT INTO BusinessTable SELECT * FROM Cte
SELECT * FROM BusinessTable
SET DATEFIRST 7 -- Set Sunday as the first day of a week
DECLARE @givenDay DATE ='20150415' --Wednesday
SELECT * FROM BusinessTable
WHERE Bdate BETWEEN
--For Monday and Sunday, select last wednesday
(CASE WHEN DATEPART(WEEKDAY,@givenDay) IN(1,2) THEN DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay)-1,0))
--For Tuesday and Wednesday, last week's Thursday and Friday
WHEN DATEPART(WEEKDAY,@givenDay) IN(3,4) THEN DATEADD(DAY,-5,@givenDay)
--For Thursday and Friday, current week's Monday and Tuesday
WHEN DATEPART(WEEKDAY,@givenDay) IN(5,6) THEN DATEADD(DAY,-3,@givenDay)
--For Saturday, current week's Wednesday
ELSE DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay),0)) END)
AND
(CASE WHEN DATEPART(WEEKDAY,@givenDay) IN(1,2) THEN DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay)-1,0))
WHEN DATEPART(WEEKDAY,@givenDay) IN(3) THEN DATEADD(DAY,-5,@givenDay)
WHEN DATEPART(WEEKDAY,@givenDay) IN(4) THEN DATEADD(DAY,-3,@givenDay)
WHEN DATEPART(WEEKDAY,@givenDay) IN(5,6) THEN DATEADD(DAY,-3,@givenDay)
ELSE DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay),0)) END)
DROP TABLE BusinessTable
If you have any feedback on our support, you can click
here.
Eric Zhang
TechNet Community Support -
Have been unable to download telegraph subscription for last 4 days since they up graded the ap. can you tell me how to restore it please?
You're the second person in two days having trouble with the Telegraph update. Step one is a reset. Press and hold both the home and power buttons for 10-15 seconds till the Apple logo appears. Release both buttons. Wait 15-20 seconds till your iPad starts on it's own.
-
Weekly schedule line should pass to last working day of the week in SAg
HI,
In a scheduling agreement when we have weekly or monthly schedules the system displays the date in the screen as 12/2010 or 13/2010 for say a weekly schedule.
However when the data is stored in the table the delivery date is always the first working day of the week. In this case when the week is 13/2010 the data is stored in the table as 22/03/2010.
Is there any way to change this to the last working day of the week?
We have some config related to define delivery intervals in IMG--> Sales and Distribution --> Sales --> Sales Documents --> Scheduling Agreements with Delivery Schedules --> Define Delivery Intervals. Will this help solve my issue? If it solves what is the procedure behind this?
Request you to provide your inputs.
Thank You, LakshmikanthHi,
Seems the delivery split concept is different from this requirement. Can Delivery intervals concept help us or not? IMG--> Slaes and Distribution --> Sales --> Sales Documents --> Scheduling Agreements with Delivery Schedules --> Control EDI Inbound Processing --> Define Delivery Intervals.
What is the procedure and assignment details for delivery intervals concept?
Thanks, Lakshmikanth -
Dynamic selective deletion of last working day in cube
Hi experts
I have studied this document:
http://scn.sap.com/community/data-warehousing/netweaver-bw/blog/2013/08/06/selective-deletion-in-process-chain
We need to delete each month at the 6th working day all records of the last working day of the previous month.
Thereafter we will have to reload the last working day of the previous month again.
This means there are 2 steps to do:
1. step:
create program as described in the link above; this z-program will be used in process chain variant.
2. step:
ABAP variable in infopackage which will reload the last working day of previous month.
Do you have the correct coding samples for both steps available?
Thanks.Hi Thomas,
I just realized that you should use LT_THX_SEL instead of L_THX_SEL. I corrected your code as:
REPORT GP00733D41Q8YF4PERY61Y1HNAP .
TYPE-POOLS: RSDRD, RSDQ, RSSG.
DATA:
L_UID TYPE RSSG_UNI_IDC25,
L_T_MSG TYPE RS_T_MSG,
L_THX_SEL TYPE RSDRD_THX_SEL.
L_UID = '00733D41Q8YF4PERYNZWX2EY9'.
IMPORT I_THX_SEL TO L_THX_SEL
FROM DATABASE RSDRBATCHPARA(DE) ID L_UID.
* DELETE FROM DATABASE RSDRBATCHPARA(DE) ID L_UID.
data: wa_tab type RSDRD_S_RANGE.
data: lt_tab type RSDRD_T_RANGE.
wa_tab-sign = 'I'.
wa_tab-option = 'EQ'.
wa_tab-keyfl = 'X'.
wa_tab-low = '20140101'.
append wa_tab to lt_tab.
clear l_thx_sel.
LT_THX_SEL-IOBJNM = '0CALDAY'.
LT_THX_SEL-TRANGE[] = LT_TAB[].
INSERT LT_THX_SEL into table L_THX_SEL.
CALL FUNCTION 'RSDRD_SEL_DELETION'
EXPORTING
I_DATATARGET = 'ZCFM_C11'
I_THX_SEL = L_THX_SEL
I_AUTHORITY_CHECK = 'X'
I_THRESHOLD = '1.0000E-01'
I_MODE = 'C'
I_NO_LOGGING = ''
I_PARALLEL_DEGREE = 0
I_NO_COMMIT = ''
I_WORK_ON_PARTITIONS = ''
I_REBUILD_BIA = ''
I_WRITE_APPLICATION_LOG = 'X'
CHANGING
C_T_MSG = L_T_MSG.
export l_t_msg to memory id sy-repid.
UPDATE RSDRBATCHREP
SET DELETEABLE = 'X'
I hope that will be the final solution Thomas.
Regards
Yasemin... -
any body have a query for last 8 days results
TIMESTAMPADD(SQL_TSI_DAY, -8, CURRENT_DATE) this is resulting only 1 day results only .if i execute this query is it displaying 8th back day results only.
i want all 8 back days results .
anybody have query for this...
Edited by: user12255470 on Apr 28, 2010 7:19 AMThis works fine for me:
SELECT "D0 Time"."T00 Calendar Date" saw_0, "F1 Revenue"."1-01 Revenue (Sum All)" saw_1 FROM "Sample Sales" WHERE "D0 Time"."T00 Calendar Date" BETWEEN TIMESTAMPADD(SQL_TSI_DAY, -8, CURRENT_DATE) AND TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE) ORDER BY saw_0
regards
John
http://www.obiee101.blogspot.com/ -
Hello Folks,
Any idea about the Std Variable for the last working day calculation.
I have a customised Characteristics to which I want to use this variable then what steps should I follow or by installing it through content will it directly get attached, I mean will be available while choosing the variables for this characteristics in a query.
Thanks,
Suyog.Hi,
Create a customer exit variable to get last working day of the month and write the following logic in ZXRSRU01:
*Last working day of the given period(Cal Yr/Month)
WHEN '<Customer exit variable>'.
DATA : BEGIN OF i_holidays OCCURS 0.
INCLUDE STRUCTURE iscal_day.
DATA : END OF i_holidays,
v_fdate LIKE sy-datum,
v_ldate LIKE sy-datum.
IF i_step = 2.
READ TABLE i_t_var_range INTO loc_var_range
WITH KEY vnam = '<Cal yr/month selection variabel>'.
IF sy-subrc = 0.
CONCATENATE loc_var_range-low
'01' INTO v_fdate.
* to get last day of the given period
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
day_in = v_fdate
IMPORTING
last_day_of_month = v_ldate.
*To get holiday list in the given period
CALL FUNCTION 'HOLIDAY_GET'
EXPORTING
holiday_calendar = <Fact cal ID>
factory_calendar = <Fact cal ID>
date_from = v_fdate
date_to = v_ldate
TABLES
holidays = i_holidays.
SORT i_holidays BY date DESCENDING.
DELETE ADJACENT DUPLICATES FROM i_holidays.
DO.
READ TABLE i_holidays WITH KEY date = v_ldate.
IF sy-subrc NE 0.
v_ldate = v_ldate - 1.
ELSE.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = v_ldate.
APPEND l_s_range TO e_t_range.
CLEAR:l_s_range.
EXIT.
ENDIF.
ENDDO.
ENDIF.
ENDIF.
Assumptions:
Running a report by entering Cal yr/month as selection value.
hope it works...
regards,
Raju -
Is it possible to create a variable in bex with the last work day?
Hi Gurus
Is it possible to create a variable in bex with the last work day?
Actually end-user every day open queries,
- Put in selection date day - 1 or
- put last Friday if the day is Monday or
- put last Thursday if the day is Monday and Friday is holiday (in a calendar for example 25 the December).
Please do the needful. It is urgent
Thanks in advance
RajTry this logic in a customer exit:
DATA: l_s_range TYPE rsr_s_rangesid.
DATA: X_PERIOD LIKE T009B-POPER,
X_YEAR LIKE T009B-BDATJ.
CASE I_VNAM.
WHEN 'ZPREVWORKDAY'.
DATA: l_DayOfWeek(1) TYPE C,
l_act_date TYPE d,
l_prev_date TYPE d.
l_act_date = sy-datum.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING DATE = l_act_date
IMPORTING DAY = l_DayOfWeek.
CASE l_DayOfWeek.
WHEN '1'.
l_prev_date = l_act_date - 3.
WHEN '2'.
l_prev_date = l_act_date - 1.
WHEN '3'.
l_prev_date = l_act_date - 1.
WHEN '4'.
l_prev_date = l_act_date - 1.
WHEN '5'.
l_prev_date = l_act_date - 1.
WHEN '6'.
l_prev_date = l_act_date - 1.
WHEN '7'.
l_prev_date = l_act_date - 2.
ENDCASE.
l_s_range-low = l_prev_date.
APPEND l_s_range TO e_t_range.
ENDCASE.
Edited by: Tyler Blouse on Feb 13, 2008 8:28 PM -
List of long running Conc Requests required for last 6 days
Hi All,
I need List of long running Conc Requests required for last 6 days.But somewhat my query is not working and giving me the output.
Could anyone please let me know what is wrong in the query which gives me the output for 60 mins but not for the last 6 days as required.
Query:
set echo off
set feedback off
set linesize 97
set verify off
col request_id format 9999999999 heading "Request ID"
col exec_time format 999999999 heading "Exec Time|(Minutes)"
col start_date format a10 heading "Start Date"
col conc_prog format a20 heading "Conc Program Name"
col user_conc_prog format a40 trunc heading "User Program Name"
spool long_running_cr.lst
SELECT
fcr.request_id request_id,
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/24))*60) exec_time,
fcr.actual_start_date start_date,
fcp.concurrent_program_name conc_prog,
fcpt.user_concurrent_program_name user_conc_prog
FROM
fnd_concurrent_programs fcp,
fnd_concurrent_programs_tl fcpt,
fnd_concurrent_requests fcr
WHERE
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/24))*60) > NVL('&min',45)
and
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/30))*6) > NVL('&days',5)
and
fcr.concurrent_program_id = fcp.concurrent_program_id
and
fcr.program_application_id = fcp.application_id
and
fcr.concurrent_program_id = fcpt.concurrent_program_id
and
fcr.program_application_id = fcpt.application_id
and
fcpt.language = USERENV('Lang')
ORDER BY
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/24))*60) desc,
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/30))*6) desc;
spool off
Thanks for your time!
Regards,Hi,
I suggest that you look at this line in particular:
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/30))*6) > NVL('&days',5)and consider whether it is asking the question that you want it to ask.
Furthermore, it looks like you are expecting to get time in minute from the following line, and this definitely does not return minutes:
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/24))*60) I recommend finding one or two IDs for concurrent requests that you know are running for a long time, comparing the start and end times, testing that information against the output of the above functions, and adjusting your query accordingly.
Regards,
John P.
http://only4left.jpiwowar.com -
I am trying to calculate Deviation Measure for the Reports and the formula to calculate is –
(average(last 7 days count ) – today’s count/100 )*10
Problem here is to calculate average for last 7 days .
I am using moving average but if I apply a filter , Moving average is calculated for the number of rows displayed whereas I want it for the number of days.
Formula for Moving average is - MAVG(Row Count,n) where n is number of rows displayed and not number of days. Is there any possible way to do it.(average(last 7 days count ) – today’s count/100 )*10
Filter( avg(col1) using date > current_date-7)) --Average for last 7 days
Filter(count(col) using date = current_date) - today's value -
Calculate data of last 30 days on basis of sys date
SELECT DT, ITEMCODE, ITEMNAME, QTY
FROM TABLE1In above given query, how i could calculate the QTY details of last 30 days, APR, MAY, and JUNE
As the current month is JULY, in AUG, the Qty details are required for last 30 days (from sysdate), MAY, JUNE, JUL
Please suggest.
Yogesh
Edited by: user12957777 on Jul 28, 2010 3:16 AMHi,
Use CASE expressions to filter data in particular columns:
SELECT SUM ( CASE
WHEN dt >= ADD_MONTHS ( TRUNC (SYSDATE, 'MONTH')
, -3
AND dt < ADD_MONTHS ( TRUNC (SYSDATE, 'MONTH')
, -2
THEN qty
END
) AS third_month
, SUM ( CASE
WHEN dt >= ADD_MONTHS ( TRUNC (SYSDATE, 'MONTH')
, -2
AND dt < ADD_MONTHS ( TRUNC (SYSDATE, 'MONTH')
, -1
THEN qty
END
) AS second_month
, SUM ( CASE
WHEN dt >= ADD_MONTHS ( TRUNC (SYSDATE, 'MONTH')
, -1
AND dt < TRUNC (SYSDATE, 'MONTH')
THEN qty
END
) AS last_month
, SUM ( CASE
WHEN dt >= TRUNC (SYSDATE) - 30
AND dt < TRUNC (SYSDATE)
THEN qty
END
) AS last_30_days
FROM table1
;You can do this with GROUP BY, also, if you want separate rows for each itemname (for example).
I had to guess at some things, such as what you mean by the last 30 days.
If you'd like to post some sample data 9CREATE TABLE and INSERT statements) and the results you want from that data, then I could test this. -
My app status is "inreview" for last 4 days.
I have uploaded my app using itunes connect after 7 days my app got reviewd but they rejected my app and displayed the status like metadata rejected. According to resoltion centre i have given specific info for review and resubmitted without adding new binary.Within hour my app status changed to "In review " but my app not reviewd yet now.It's in same status for last four days.What i need to do now? Is any way to get the reason of delay from apple?
Hi, LTKS.
Thank you for visiting Apple Support Communities.
Try removing the preference to sync calendar events in iCloud preferences. Once this is down enable the preference again and see if this resolves the issue.
Turn iCloud Calendars off and back on:
Quit Calendar (or iCal).
Choose Apple () menu > System Preferences, then select iCloud.
Deselect the checkbox next to Calendars.
Close System Preferences and wait about a minute.
Open System Preferences and select iCloud.
Replace the checkmark next to Calendars.
Close System Preferences.
Open Calendar (or iCal) and test to see if the issue is resolved.
Restart your computer. This may sound simple, but it reinitializes your network and application settings and can frequently resolve issues.
If the issue persists, try all remaining steps in the article below.
iCloud: Troubleshooting iCloud Calendar
http://support.apple.com/kb/TS3999
Regards,
Jason H.
Maybe you are looking for
-
Email and iTunes apps are now in an app called "lifestyle". How do I get them out?
email and iTunes apps are in an app called "lifestyle". Don't know how they got there and want them out. Help.
-
How to Call the RFC in Webdynpro abap application
Dear Experts, Good Evening to all... I have to add two numbers using RFC in webdynpro abap application. If we give the numbers in the input screen then the RFC should add it and give it in the output screen. This is the application for that I have cr
-
Running an Intel Mac on a Wireless Network with other Power PC Macs
I know changing the Airport to WPA encryption will allow an intel Mac with either Mac OS or WinXP OS to access the airport. If you have powerPC Macs also, what encryption will allow both Mac (intel and powerPC) and WinXP to access the airport? Right
-
Getting MIDI CC to send Notes? How does it work? CC#1-127 to Notes
-
hi experts, i m in need to create a report means i have to design the screen,in which i have to use LDB pnpce for HR,but if i select program type "module pool" in the report attributes the filed LDB name is not coming means but when i select executa