Count consecutive days in array
Hi,
I'm looking for an algorithm to count consecutive days in array, but i don't find one.
for example, if i have this array.
2009/07/01
2009/07/02
2009/07/03
2009/07/06
2009/07/08
2009/07/09
2009/07/10
2009/07/11
The result be
3
1
4
Anyone have one?
Thanks for all.
jverd wrote:
kajbj wrote:
It's a fairly specialist algorithm so you are unlikely to find someone to post a solution. By just keeping a reference to the previous date, it is easy to iterate though the list counting consecutive dates.I think the trick to making this algorithm sucessful is to make sure that when you change months your algorithm doesn't set consec_days to 0 Why not?Presumably he's talking about this case:
7/31
8/1
and not this case
7/1
8/1
So he really should have said, "...when you increment month by one, or from 12 to 1, and the day went from the last day of the old month to 1, don't set consec_days to 0"Ok. I would use the Calendar class and SimpleDateFormat. The tricky part would otherwise be to keep track of days per month, and leap year.
Similar Messages
-
Count consecutive Workdays where employee has taken SICK leave
I am trying to identify a way within sql to count the number of consecutive workdays (Monday - Friday) an employee has taken SICK leave. My problem in the past has been trying to count days whereas we cross the weekend. Currently I have 4 queries identifying patterns around the weekend that I run and export into an Excel Spreadsheet and manipulate from there. My goal is to be able to list an EMPLID (employee id), EMPL_RCD ( employee record), Min(DUR) (Date of absence), Max(DUR), and count of consecutive workdays.
Any help or guidance would will be appreciated. I have attached my current query.
I run my current query 4 times using the patterns below one at a time.
SELECT DISTINCT A.EMPLID,A.EMPL_RCD, A.DUR,b.dur,c.dur,d.dur, A.TL_QUANTITY, A.TRC
FROM PS_TL_RPTD_TIME A, PS_TL_RPTD_TIME B, PS_TL_RPTD_TIME C,PS_TL_RPTD_TIME D
WHERE A.EMPLID = B.EMPLID
AND A.EMPL_RCD = B.EMPL_RCD
AND A.EMPLID = C.EMPLID
AND A.EMPL_RCD = C.EMPL_RCD
AND A.EMPLID = D.EMPLID
AND A.EMPL_RCD = D.EMPL_RCD
AND B.EMPLID = C.EMPLID
AND B.EMPL_RCD = C.EMPL_RCD
AND B.TRC = C.TRC
AND A.TRC = B.TRC
AND A.TRC = C.TRC
AND A.TRC = D.TRC
AND (B.DUR = A.DUR+3 AND C.DUR = A.DUR+4 AND D.DUR = A.DUR+5) Friday, Monday, Tuesday, Wednesday
AND (B.DUR = A.DUR+1 AND C.DUR = A.DUR+4 AND D.DUR = A.DUR+5) Thursday, Friday, Monday, Tuesday
AND (B.DUR = A.DUR+1 AND C.DUR = A.DUR+2 AND D.DUR = A.DUR+5) Wednesday, Thursday, Friday, Monday
AND (B.DUR = A.DUR+1 AND C.DUR = A.DUR+2 AND D.DUR = A.DUR+3) -- Same workweek
AND A.TRC LIKE 'SICK%'
AND NOT EXISTS ( SELECT 'x' FROM PS_JOB J
WHERE J.EMPLID = A.EMPLID
AND J.EMPL_RCD = A.EMPL_RCD
AND J.EMPL_STATUS IN ('P','L')
AND J.EFFDT = ( SELECT MAX(J1.EFFDT) FROM PS_JOB J1
WHERE J1.EMPLID = J.EMPLID
AND J1.EMPL_RCD = J.EMPL_RCD
AND J1.EFFDT <= D.DUR))You should consider a technique from data warehousing where you use a table to describe dates. To keep things simple, let's create a table that holds all your valid business days for the past 2 weeks...
create table business_dates (business_day date);
begin
insert into business_dates values (to_date('16-oct-2006'));
insert into business_dates values (to_date('17-oct-2006'));
insert into business_dates values (to_date('18-oct-2006'));
insert into business_dates values (to_date('19-oct-2006'));
insert into business_dates values (to_date('20-oct-2006'));
insert into business_dates values (to_date('23-oct-2006'));
insert into business_dates values (to_date('24-oct-2006'));
insert into business_dates values (to_date('25-oct-2006'));
insert into business_dates values (to_date('26-oct-2006'));
insert into business_dates values (to_date('27-oct-2006'));
insert into business_dates values (to_date('30-oct-2006'));
insert into business_dates values (to_date('31-oct-2006'));
insert into business_dates values (to_date('01-nov-2006'));
insert into business_dates values (to_date('02-nov-2006'));
insert into business_dates values (to_date('03-nov-2006'));
end;
now we create a table that shows whether each employee was sick or not for a given work day...
create table attendance (empid number, business_day date, sick char(1));
insert into attendance values (100, to_date('16-oct-2006'), 'N');
insert into attendance values (100, to_date('17-oct-2006'), 'Y');
insert into attendance values (100, to_date('18-oct-2006'), 'Y');
insert into attendance values (100, to_date('19-oct-2006'), 'N');
insert into attendance values (100, to_date('20-oct-2006'), 'N');
insert into attendance values (100, to_date('23-oct-2006'), 'Y');
insert into attendance values (100, to_date('24-oct-2006'), 'Y');
insert into attendance values (100, to_date('25-oct-2006'), 'Y');
insert into attendance values (100, to_date('26-oct-2006'), 'N');
insert into attendance values (100, to_date('27-oct-2006'), 'N');
insert into attendance values (100, to_date('30-oct-2006'), 'N');
insert into attendance values (100, to_date('31-oct-2006'), 'Y');
insert into attendance values (100, to_date('01-nov-2006'), 'N');
insert into attendance values (100, to_date('02-nov-2006'), 'N');
insert into attendance values (100, to_date('03-nov-2006'), 'N');
insert into attendance values (105, to_date('16-oct-2006'), 'Y');
insert into attendance values (105, to_date('17-oct-2006'), 'Y');
insert into attendance values (105, to_date('18-oct-2006'), 'N');
insert into attendance values (105, to_date('19-oct-2006'), 'N');
insert into attendance values (105, to_date('20-oct-2006'), 'Y');
insert into attendance values (105, to_date('23-oct-2006'), 'N');
insert into attendance values (105, to_date('24-oct-2006'), 'N');
insert into attendance values (105, to_date('25-oct-2006'), 'Y');
insert into attendance values (105, to_date('26-oct-2006'), 'Y');
insert into attendance values (105, to_date('27-oct-2006'), 'Y');
insert into attendance values (105, to_date('30-oct-2006'), 'Y');
insert into attendance values (105, to_date('31-oct-2006'), 'Y');
insert into attendance values (105, to_date('01-nov-2006'), 'N');
insert into attendance values (105, to_date('02-nov-2006'), 'N');
insert into attendance values (105, to_date('03-nov-2006'), 'Y');
Now the query to get each sick occurrence and the number of consecutive days for each employee is...
select empid, first_sick_day, sick_count from
(select empid,
first_value(business_day) over (partition by empid, groupno order by business_day) as first_sick_day,
row_number() over (partition by empid, groupno order by business_day) as rn,
count(*) over (partition by empid, groupno) as sick_count
from
(select empid, business_day, daynum-rownum groupno
from
(SELECT a.empid, a.business_day, d.day_num as daynum
FROM attendance a,
(select rownum as day_num, business_day
from (select business_day from business_dates order by business_day)) d
WHERE sick = 'Y' AND a.business_day = d.business_day
ORDER BY 1,2 )
where rn = 1;
The above query can be modified slightly to only give you the sick occurrence with the maximum number of consecutive days for each employee.
Having a separate date table is nice because you can take in account weekends, holidays or any other nonwork day by just removing that date from the table. Generating this table is easy as date dimension examples can be found on on the web, and the amount of rows is small (250 rows per year approx).
JR -
Experts.
I have a query request using InfoSource 0HR_PT_2. (data volume is extremely large with this extractor.)
Business has 100k employees.
Client wants to see which persons have consecutive absences >= 20 days. (NOT 20 days or more total)
I have the restrictions on TYPES or ABSENCE and Users have not defined the periods of their search. (month to month, year to year?)
How can I count hours / days of data that sum up to 20 consecutive days?
Thanks for any suggestions, both backend or query based.
SteveExperts.
I have a query request using InfoSource 0HR_PT_2. (data volume is extremely large with this extractor.)
Business has 100k employees.
Client wants to see which persons have consecutive absences >= 20 days. (NOT 20 days or more total)
I have the restrictions on TYPES or ABSENCE and Users have not defined the periods of their search. (month to month, year to year?)
How can I count hours / days of data that sum up to 20 consecutive days?
Thanks for any suggestions, both backend or query based.
Steve -
Latest Number of Consecutive Days ("Current Streak")
Using SQL Server (On Azure)
I am trying to figure out how to get the latest number of consecutive days in an SQL query.
I have a habit tracking app in which I keep track of best streaks, originally I was storing this "Streak" value as it's own column in the Habit table and changing it directly. This of course led to incorrect syncing and accuracy issues. I realize
the best way to do it is to calculate from existing data.
I simplified the 2 tables as listed below:
Habit
id (the habit id)
Name (the name of the habit)
Target (the target number of entries required to be considered completed)
HabitEntry
id (the habit entry id)
HabitID (the corresponding habit id)
EntryDate (the date and time of the entry)
Looking to get a query that looks something like this:
SELECT habit.id, habit.Name, (*subquery*) as 'CurrentStreak' from habit join habitentry on habit.id = habitentry.habitid
And outputs something like this:
1, 'Exercise Daily', 7
If the habit's target is 2, there must be 2 entries within that date to be considered completed and to add to the streak.
Not sure if this complicates things, but days are measured from 3:00am to 3:00am, any help is greatly appreciated.Figured I'd throw this in just for the fun of it. :)
IF OBJECT_ID('tempdb..#Habbit') IS NOT NULL DROP TABLE #Habbit
CREATE TABLE #Habbit (
ID INT PRIMARY KEY,
Name VARCHAR(255),
[Target] INT
INSERT #Habbit (ID,Name,Target) VALUES
(1,'Three Day Thing', 3),
(2,'Four Day Thing', 4),
(3,'Five Day Thing', 5)
--=============================================
IF OBJECT_ID('tempdb..#HabitEntry') IS NOT NULL DROP TABLE #HabitEntry
CREATE TABLE #HabitEntry (
UserID INT,
HabbitID INT,
EntryDate DATETIME
INSERT #HabitEntry (UserID,HabbitID,EntryDate) VALUES
(1, 1, '20150101 06:35:30'),
(1, 1, '20150102 08:35:30'),
(1, 1, '20150103 08:35:30'),
(1, 1, '20150110 09:35:30'),
(1, 1, '20150112 10:35:30'),
(1, 1, '20150115 22:35:30'),
(1, 1, '20150116 23:35:30'),
(1, 1, '20150117 00:35:30'),
(1, 1, '20150118 01:35:30'),
(1, 1, '20150122 04:35:30'),
(1, 1, '20150124 05:35:30'),
(1, 1, '20150126 15:35:30'),
(1, 1, '20150127 10:35:30'),
(2, 3, '20150101 06:35:30'),
(2, 3, '20150102 06:35:30'),
(2, 3, '20150103 02:35:30'),
(2, 3, '20150104 06:35:30'),
(2, 3, '20150105 06:35:30'),
(2, 3, '20150108 06:35:30'),
(2, 3, '20150110 06:35:30'),
(2, 3, '20150111 06:35:30'),
(2, 3, '20150112 06:35:30'),
(2, 3, '20150113 06:35:30'),
(2, 3, '20150114 06:35:30'),
(2, 3, '20150122 06:35:30'),
(2, 3, '20150123 06:35:30')
--=============================================
DECLARE @MinDate DATE, @RangeSize INT
SELECT @MinDate = DATEADD(dd, -1, MIN(he.EntryDate)) FROM #HabitEntry he
SELECT @RangeSize = DATEDIFF(dd, @MinDate, MAX(he.EntryDate) + 1) FROM #HabitEntry he
IF OBJECT_ID('tempdb..#CalRanges') IS NOT NULL DROP TABLE #CalRanges
SELECT TOP (@RangeSize)
DATEADD(dd, ROW_NUMBER() OVER (ORDER BY (SELECT NULL)), @MinDate) AS [Date],
DATEADD(hh, 3, DATEADD(dd, ROW_NUMBER() OVER (ORDER BY (SELECT NULL)), CAST(@MinDate AS DATETIME))) AS BegRange,
DATEADD(hh, 27, DATEADD(dd, ROW_NUMBER() OVER (ORDER BY (SELECT NULL)), CAST(@MinDate AS DATETIME))) AS EndRange
INTO #CalRanges
FROM sys.all_objects ao
--=============================================
;WITH cte AS (
SELECT
cr.Date,
he.UserID,
he.HabbitID,
he.EntryDate,
COALESCE(LAG(CASE WHEN he.EntryDate IS NOT NULL THEN cr.Date END, 1) OVER (PARTITION BY he.UserID, he.HabbitID ORDER BY cr.Date), '19000101') AS PrevDate
FROM
#CalRanges cr
JOIN #HabitEntry he
ON he.EntryDate BETWEEN cr.BegRange AND cr.EndRange
--AND he.UserID = 1
), cte2 AS (
SELECT
c.*,
CASE WHEN DATEDIFF(dd, c.PrevDate, c.Date) <> 1 THEN ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) END ConseqGroup
FROM cte c
WHERE c.Date <> c.PrevDate
), cte3 AS (
SELECT
c2.*,
CAST(SUBSTRING(MAX(CAST(c2.Date AS BINARY(4)) + CAST(c2.ConseqGroup AS BINARY(4))) OVER (PARTITION BY c2.UserID, c2.HabbitID ORDER BY c2.Date), 5, 4) AS INT) AS ConseqGroupFill
FROM cte2 c2
), cte4 AS (
SELECT
c3.UserID,
c3.HabbitID,
h.Name AS HabbitName,
MIN(c3.EntryDate) AS BegDate,
MAX(c3.EntryDate) AS EndDate,
COUNT(*) AS DaysInSeries
FROM
cte3 c3
JOIN #Habbit h
ON c3.HabbitID = h.ID
GROUP BY
c3.UserID,
c3.HabbitID,
c3.ConseqGroupFill,
h.Name
HAVING
COUNT(*) >= MAX(h.Target)
-- SELECT * FROM cte4
SELECT
c4.*
FROM (SELECT DISTINCT he.UserID, he.HabbitID FROM #HabitEntry he) AS a
CROSS APPLY (
SELECT TOP 1
FROM cte4 c4
WHERE a.UserID = c4.UserID
AND a.HabbitID = c4.HabbitID
ORDER BY c4.BegDate DESC
) c4
HTH,
Jason
Jason Long -
How to count the days between Date Range using OO ABAP?
hi experts,
i want to count the days between Date Range using OO ABAP for that which class and method can i use?.
Thanks,
Mahesh.Not sure I understand the requirement for it to be OO, but you could always write your own (i.e. use this):
REPORT zz_date_diff.
CLASS date_diff DEFINITION.
PUBLIC SECTION.
METHODS diff IMPORTING i_date_fm TYPE d
i_date_to TYPE d
EXPORTING e_days TYPE i.
ENDCLASS."
CLASS date_diff IMPLEMENTATION.
METHOD diff.
e_days = i_date_to - i_date_fm.
ENDMETHOD."
ENDCLASS."
DATA: g_ref TYPE REF TO date_diff,
g_days TYPE i,
g_date_fm TYPE d VALUE '20080101',
g_date_to TYPE d VALUE '20090101'.
START-OF-SELECTION.
CREATE OBJECT g_ref.
CALL METHOD g_ref->diff
EXPORTING
i_date_fm = g_date_fm
i_date_to = g_date_to
IMPORTING
e_days = g_days.
WRITE g_days. -
Is there a background for iphone that counts down days??
Is there an app or background that will count down days??
Counts down days to like a trip or to an event of some sort.
-
How to find consecutive days?
Hi I have a requirement, where I need to find all employees who have taken 5 consecutive days off in one week.
I am trying to build a query in BI, which can identify these records, but of no avail. I am wondering if I can do this in visual Composer. My data output currently looks like this in a table.
Employee number calendar day time-off hours
100 6/8/2009 8
100 6/9/2009 8
100 6/10/2009 8
100 6/11/2009 8
100 6/12/2009 8
101 6/1/2009 8
101 6/5/2009 8
I like to loop through this table, somehow, and identify that employee 100, has 5 consecutive days off, but not 101.
I like to filter those employees who do not have 5 consecutive days off, and just show those who have 5 days off, like employee number 100. My output should look like, this
Employee number calendar day time-off hours
100 6/8/2009 8
100 6/9/2009 8
100 6/10/2009 8
100 6/11/2009 8
100 6/12/2009 8
Any ideas will be greatly appreciated. I am trying out dynamic expression, but cannot find a way to access the first row of data, while processing the second row.Hi
Why dont you try with time characteristics '0CALWEEK'. Add '0CALWEEK' to your infocube & map it with the date which you already have in the table. Now consider the your example for employee '100' -
100 6/8/2009 8
100 6/9/2009 8
100 6/10/2009 8
100 6/11/2009 8
100 6/12/2009 8
by adding Calweek you will get - 100 24.2009 (that is 24 th week) 40 hrs.
Now in your query divide this 40 hrs (that is total working hours in week) with daily min working hrs. (In your case assume it 8 Hrs per day). So in query you will get number of working days in a week for each employee. From this you can easily find out how many leaves each employee has taken.
I think this is what you are looking for.
Regards
Sandeep -
App Hangs in 3 consecutive days
Hi all,
11.2.0.1
Aix 6.1
Our database & app hangs for the first time, 3 consecutive days (Aug 11,12,13) during run of batch jobs at 12AM.
The batch operator said the batch job is deleting a table with only less than 1000 rows but was not able to lock the table as there lots of updates queues from lots of client app.
I check the alert log for the said time period and this is the output. I saw similar occurences at 1AM
Tue Aug 13 01:20:45 2013
Clearing standby activation ID 2855092487 (0xaa2d4107)
The primary database controlfile was created using the
'MAXLOGFILES 16' clause.
There is space for up to 10 standby redo logfiles
Use the following SQL commands on the standby database to create
standby redo logfiles that match the primary database:
ALTER DATABASE ADD STANDBY LOGFILE 'srl1.f' SIZE 262144000;
ALTER DATABASE ADD STANDBY LOGFILE 'srl2.f' SIZE 262144000;
ALTER DATABASE ADD STANDBY LOGFILE 'srl3.f' SIZE 262144000;
ALTER DATABASE ADD STANDBY LOGFILE 'srl4.f' SIZE 262144000;
ALTER DATABASE ADD STANDBY LOGFILE 'srl5.f' SIZE 262144000;
ALTER DATABASE ADD STANDBY LOGFILE 'srl6.f' SIZE 262144000;
ALTER DATABASE ADD STANDBY LOGFILE 'srl7.f' SIZE 262144000;
Tue Aug 13 02:00:00 2013
Closing scheduler window
Closing Resource Manager plan via scheduler window
Clearing Resource Manager plan via parameter
Tue Aug 13 04:36:07 2013
WARNING: Heavy swapping observed on system in last 5 mins.
pct of memory swapped in [9.53%] pct of memory swapped out [23.33%].
Please make sure there is no memory pressure and the SGA and PGA
are configured correctly. Look at DBRM trace file for more details.
Tue Aug 13 05:07:14 2013
Thread 1 cannot allocate new log, sequence 49033
Private strand flush not complete
AlertSunday Aug 11
https://app.box.com/s/6ut7uk0o5y6tg2sjfzvn
AlertMonday Aug 12
https://app.box.com/s/gafa2d1ngn7hpen6tfky
AlertTuesday Aug 13
https://app.box.com/s/o5v5gtul1mr3yra6vbgj
Do you have any idea what causes tha hang? Its weird because these did not happened before.
Please help...
Thanks a lot,
zxyThanks,
Does these ASH, & AWR reports shows anything?
ASH
https://app.box.com/s/bmuafe2y39mzo036bbij
https://app.box.com/s/jdfv3uauwhp7tttvqlig
https://app.box.com/s/7r0sej0r77n3jay7n1fd
AWR
https://app.box.com/s/fdyx0rare2tskd291f1w
https://app.box.com/s/0pd4u7kzt0p10rhgnivq
https://app.box.com/s/sjotdxe57pssjitabrj2
Thanks, -
Hey huys,
I have a problem with the count of working days in the report I am developing.
I make the count of days with TIMESTAMPDIFF but this return all days between Start Date and end date and I Want only working days. I have a column that says if the day is a work day or not.
I don´t have any idea how I make the comparison day by day.
Can any suggest how I do it.
CumpzWe can try to create a function in DB which returns the Number of Working Days on passing the Start Date and End Date of Campaign Calendar
By you saying there is a column "Work Day" with flag "Yes" or "NO", I assume there is a table called Campaign Calendar which may provide this info like if each and every day is working day or not.
For ex:
Work_Day Flag
02-SEP-13 00:00:00 YES
03-SEP-13 00:00:00 YES
04-SEP-13 00:00:00 YES
05-SEP-13 00:00:00 YES
06-SEP-13 00:00:00 YES
07-SEP-13 00:00:00 NO
08-SEP-13 00:00:00 NO
If the above is the case, then try to create a function as below which return number of working days between two dates
CREATE
FUNCTION DATE_DIFF(ST DATE, ED DATE) RETURN NUMBER
IS NO_OF_WDAYS NUMBER;
DT1 DATE := ST; ---VARIABLE TO HOLD START DATE
CHR1 VARCHAR2(10); ----VARIABLE TO HOLD FLAG FOR EACH DATE
HOLIDAY NUMBER := 0; ----COUNTER WHICH GIVES US NUMBER OF HOLIDAYS BETWEEN TWO DATES INCLUDING SATURDAYS AND SUNDAYS
BEGIN
NO_OF_WDAYS := TRUNC(ED - ST);
LOOP
SELECT Work_Day /* THE COLUMN WHICH HOLDS THE FLAG*/
INTO CHR1
FROM CAMPAIGN_CALENDAR /* THE TABLE WHICH HAS THE INFO */
WHERE DATE_COLUMN = DT1;
IF(CHR1 = 'NO') THEN
HOLIDAY := HOLIDAY + 1;
END IF;
DT1 := DT1 + 1;
EXIT WHEN DT1 > ED;
END LOOP;
NO_OF_WDAYS := NO_OF_WDAYS - HOLIDAY;
RETURN NO_OF_WDAYS;
END DATE_DIFF;
Once the above function is written, use Evaluate function in the RPD and pass both the columns as parameters.
EVALUATE('DATE_DIFF(%1,%2)' ,Campaign Start Date,Campaign End Date)
Whenever the column gets pulled in the report, the above db function will be fired hence resulting in Number of Working days.
Hope its helpful
Srikanth -
Count of days exclude sat'day and sunday
Hi,
I'm able to get count of days in current month as of today but not able to exclude weekends. Please advise.
My query
SELECT TRUNC(SYSDATE)-TRUNC(SYSDATE,'MM') FROM DUAL
I want very simple query something like show below. please don't use connect and level key words because they aren't supported by OBIEE.
SELECT TRUNC(SYSDATE)-TRUNC(SYSDATE,'MM') FROM DUAL
where wday not in ('sat','sun');
Thanks
ASHCheer this
http://siebel.ittoolbox.com/groups/technical-functional/siebel-analytics-l/calcuate-the-difference-between-two-given-dates-excluding-weekends-2041897
Re: Date Differance in days (except Sat/Sun)
Cheers
Nawneet -
Single Class Split Over multiple non-consecutive Days??
How do I setup in OLM a class split over multiple days for Example:
I have a Diversity Awareness Course and Offering. The Class is 2 days long, but not on consecutive days, they are a week apart.
Do I create a Day1 Class and Day2 class under the same course and make it a prerequisite to attend day 1?
From a reporting point of view this now shows as 2 classes when it is only 1; inflating the class figures.
Or Can I split it into 2 sessions under the same class?
What is the best way to do this?Hi!
You can create a Class with two Sessions underneath it (one for each day). Make the Start Date for the Class the day the Class begins and set the End Date to correspond to the last day. Your Duration should be set to 2 Days. Learners will be able to view details for each session, and you can assign different instructors and rooms for each day if you use Resource Bookings in OLM.
Anne
Anne Saulnier | Synergy Codeworks LLC
[email protected]
603-864-9942 -
HELP: PCR using AAU** can not count absence days that less than a day
Hi, experts
I have customized a PCR using AAU**
But it can not count absence days that less than a day which is maintained in IT 2001 ,
such as unpaid leave. However it can correctly count absence days that last one day or above .
The issue is so strange for me, so please give me some advice.
Thanks a lot !
Morgan from Shanghai, China
2011-6-10Morgan
1 alternative approach is as follows:
Step 1: Ensure your absence type have already been mapped to an absence valuation rule
Step 2: In your absence valuation rule, (goto SM30 > V_t554c), assign a new wage type to capture the number of days
The wage type in step 2 should be created such that its attributes is to help your capture number of days of your unpaid
absence type when it is evaluated by your payroll schema
Final Step: You should be able to capture half day absences with such a wage type when you run your payroll calculations
Should you need to utilize such a wage type for subsequent calculation processing in your payroll schema, you may have to develop your own customer payroll calculation rules to do so -
Hi,
I had a requirement like this
<pre>
In Table View output is like this
ID STATUS DATE
101 01 03-01-11
101 02 09-02-11
101 03 11-03-11
101 02 06-04-11
101 02 07-05-11
101 03 09-06-11
101 02 14-07-11
101 02 15-08-11
101 04 12-09-11
101 03 10-10-11
101 03 12-11-11
101 03 08-12-11
</pre>
<pre>
Required Output should be like this - for ID 101 and STATUS '01' is not required
STATUS 1Time 2Time 3&4Time 5&above
02 1 2
03 2 1
04 1
</pre>
Columns 1Time, 2Time,3&4Time, 5&above means count the number of consecutive appeareance of the status (have to check previous month status and next month status)
i.e for example if we take Status '02'
after checking previous month and next month status, Status '02' has appeared one time consecutively on '01-02-11'(Feb)
and hence 1 should come under '1Time' Column.
similarly after checking previous month and next month status, the number of 2 consecutive appereance of status '02' is twice, that is on ('01-04-11', '01-05-11') and ('01-07-11', '01-08-11'),hence the count of them will 2 under '2Time' column
For Status '03',
there are two one-time consecutive appeareance of the Status, that is on '01-03-11' and '01-06-11'. Hence count is 2 under '1Time' column for status 03
and Status '03' has single 3 consecutive appearance, that is on '01-10-11', '01-11-11', '01-12-11', hence count is 1 under 3&4Time coulmn.
Regards
mohanI did answer your question in the other forum:
Count consecutive appearance
hm -
Birthday from calendar appears on two consecutive days when synced with iPo
Hello.
This has utterly confounded me.Hello, tt2.
My original post appeared twice because somehow I managed to click the wrong command before I finished it the first time. Either that or the cat walked across the keyboard!
Each birthday and anniversary in my iCal is set for 'all day', from and to the same date, to repeat annually and end never, but this is the only one that is in iCal for one day a year, yet on the iPod for two consecutive days a year.
I've removed all calendar files from the iPod manually and then re-synced, but the problem persists.
Thanks. -
Select non-consecutive days in Calendar input
Hi Experts,
I designed a form in WD and have a requirement, where I need to show up a calendar display of months in which an user should be allowed to select only non-consecutive days from it.
Also I need to get all those selected days at run-time.
Is it possible?? I know that calendar is a standard input of date UI element and totally confused as how I can restrict an user to select only non-consecutive days.
Please clarify and help me in this.
BR,
RAM.Hi RAM,
Unfortunately, with the date navigator ui element, we cannot select multiple dates except the date ranges.
Work around solution:
I suggest you to go for row repeater, in which you can place date navigator ui element and user can add multiple rows: also you he can input dates by selecting single dates.
Here you can also restrict the user to select only non-consecutive dates.
Pls refer the wiki for an example:
steps to create row repeater ui element - Web Dynpro ABAP - SCN Wiki
Try to convince the user with this or you can also for a table with single row.
Hope this helps you.
Regards,
Rama
Maybe you are looking for
-
I had an itunes account I shared with my family. I opened a separate account when I got a new phone but cant't transfer my library of music. I want to cancel new account and go back to original shared account. How do I do this?
-
MIRO should not happen for Movement Type 107
Dear All, We have a peculiar scenario/requirement fulfilled by business and we have done almost all but getting stuck in below area: We have developed a output type in order to automatically post Mat Doc with Movement Type 107 once the user reverses
-
I've been using iphone 3G for almost a year now. I've been terribly disappointed in the AT&T service as it doesn't work in the two places where I spend the most time, home and work. Home is worse, being that I live in a major metro area and whenever
-
Hi All, How can I load an entire tree in a single method ( even recursive) without using "OnLoadChildren" event. Thanks.
-
51032257 NW 2004s SR2 Java based SW Component Not Able to download
Hi all the expert here I am trying to download the following files from the SAP Service Marketplace->Installations and Upgrades->SAP Application Components->IDES SOLUTIONS->IDES SEM-BW 6.0/7.00 51032257 - NW 2004s SR2 Java based SW Comp I have tried