Count records for a specific date range
Hi,
I am using BI Publisher with Siebel 8.1.1.1. I have a monthly report where I want to count the number of service requests entered per customer per month.
I am using the following expression that works for one month:
<?count(ssServiceRequest[ssSeverity[.='1-Critical'] and xdoxslt:date_diff('d',psfn:getCanonicalDate(ssCreated), xdoxslt:current_date($_XDOLOCALE,$_XDOTIMEZONE), $_XDOLOCALE, $_XDOTIMEZONE) <=28])?>
However, I want to be able to specify a specific date range for my count, i.e ssCreated >= '01/02/2011' and <= '28/02/2011', as opposed to count for the past 28 days. Can you please advise what syntax I can use to specify a date range?
Any help will be greatly appreciated!
Claire
Hello,
Many many thanks for your reply.
I'm doing as you suggest and am using the date_diff to the end of the period in question. I've tried the following to get the number of Service Requests with Severity 1-Critical, created in Jan 2011, feb 2011:
<?count(ssServiceRequest[ssSeverity[.='1-Critical'] and xdoxslt:date_diff('d', (psfn:getCanonicalDate(ssCreated), $_XDOLOCALE, $_XDOTIMEZONE), '2011-01-31', $_XDOLOCALE, $_XDOTIMEZONE) <=31])?>
<?count(ssServiceRequest[ssSeverity[.='1-Critical'] and xdoxslt:date_diff('d', (psfn:getCanonicalDate(ssCreated), $_XDOLOCALE, $_XDOTIMEZONE), '2011-02-28', $_XDOLOCALE, $_XDOTIMEZONE) <=28])?>
In my xml sample data that I'm using I have 2 service requests that mean the criteria for Jan, yet when I run my report I'm getting '0'. The problem seems to be with my end of period date '2011-01-31'. I've also tried with both start and end period date (using a negative value as per your suggestion), but I still get '0':
<?count(ssServiceRequest[ssSeverity[.='1-Critical'] and xdoxslt:date_diff('d', (psfn:getCanonicalDate(ssCreated), $_XDOLOCALE, $_XDOTIMEZONE), '2011-01-01', $_XDOLOCALE, $_XDOTIMEZONE) <=-31 and xdoxslt:date_diff('d', (psfn:getCanonicalDate(ssCreated), $_XDOLOCALE, $_XDOTIMEZONE), '2011-01-31', $_XDOLOCALE, $_XDOTIMEZONE) <=31])?>
Many thanks,
Claire
Similar Messages
-
Sync with Outlook ONLY for a specific date range
I have a Zire 31 that I'm syncing with Outlook via latest Palm Desktop/HotSync. I did just install the latest conduit.
I was getting several repeating calendar entries that were not syncing with the Zire (annual birthdays, etc.) - turns out that they did not have an "end-date" specified when created in Outlook. Creating an end-date solved the problem.
However - I would like to know if it is possible to specify a certain date range for the device to sync (e.g., sync calendar only for years 2007 through 2050, or in other words sync from 1 year ago to 50 years in future, etc...)
I recall specifying this once years ago, but I may have been using a third party to sync with Lotus Notes at the time. I'm wondering if this option is also available with syncing directly with Outlook using HotSync??? I can't imagine it's not, but I can't find where you specify it.
One more interesting note: while my Zire 31 had issues syncing those repeating calendar entries - my much older HandSpring Visor Deluxe syncs them no problem! Go figure.
Thanks much -
Post relates to: Zire 31I'm not actually looking to purge old items.
Rather - I would like to ONLY sync calendar entries between a specified range of dates. For example - ONLY sync for calendar entries between Jan 1 2007 and Jan 1, 2050.
the problem is that I have some repeating entries (birthdays, etc.) that are set up in Outlook with no end date. Apparently Palm/HotSync is having trouble syncing these (they don't show up at all - for any year.)
One resolution is to apply an end-date for each repeating calendar entry. However, this is just another step my wife needs to remember to do. If you happen to forget to to this, then Hotsync will ignore that entry. Fine if you realize that's happening, but if you forget and forget to check - you won't even know it didn't sync!
The other possible resolution is to only have HotSync sync for a SPECIFIC date range - one that does not presumably go to infinity. That is my question - how does one sync ONLY for a specific date range. Has nothing to do with purging old entries.
Thanks!!
Post relates to: Zire 31 -
How to get the weekends days for a specific date range
I want to select list of only weekend dates from a given date range. Is it possible in SQL?
For example if the range is '08/01/2011' and '08/30/2011'
I want a list
08/06/2011
08/07/2011
08/13/2011
08/14/2011
08/20/2011
08/21/2011
08/27/2011
08/28/2011Thank You, Naveen email:[email protected]First and easy to do is having a Calendar table, which over there you can have those information.
http://arbibaghdanian.blogspot.com/2011/05/calendar-table.html
Declare @beginDate Date, @EndDate Date
Select @beginDate = '08/01/2011', @EndDate = '08/31/2011'
Declare @Calendar Table
(CalendarDate Date Primary key, IsWeekend Bit, YearNo SmallInt, QuarterNo TinyInt, MonthNo TinyInt, DayOfYearNo SmallInt, DayNo TinyInt, WeekNo TinyInt, WeekDayNo TinyInt)
While @beginDate <= @endDate
Begin
Insert Into @Calendar
Select
@beginDate As CalendarDate
,(Case When DATEPART(Weekday, @beginDate) In (7, 1) Then 1 Else 0 End) As IsWeekend
,DATEPART(Year, @beginDate) As YearNo
,DATEPART(QUARTER, @beginDate) As QuarterNo
,DATEPART(MONTH, @beginDate) As MonthNo
,DATEPART(DayOfYear, @beginDate) As DayOfYearNo
,DATEPART(Day, @beginDate) As DayNo
,DATEPART(Week, @beginDate) As WeekNo
,DATEPART(WEEKDAY, @beginDate) As WeekDayNo
Set @beginDate = DateAdd(Day, 1, @beginDate)
End
Select * From @Calendar Where IsWeekend = 1
Best Wishes, Arbi --- MCC 2011; Please vote if you find this posting was helpful or Mark it as answered. -
How to see Control chart for a specific date range in QGC3
Hi
I am developing SPC for my client.I am facing one problem.
I am using one control chart for all inspection lot for a particular MIC.Free inspection point is used in inspection plan.
Control chart is used 516.(XMR chart)
Now when i am calling control chart for MIC executing QGC3,chart is showing results since creation chart date to todays date.
Now if i want to see chart for a particular period or date range,what is the procedure.
Thanks in advance
NilanjanHi,
1. Even though when i give the Created on, and to date the system is displaying the report which is prior to the created on date.
2. Similarly the report data is different when the field is maximum no of Hits is given. for example when i giving this field as 10, 20, 30, etc the report is showing only 10 line items. if i enter 50, 60 etc it is showing the list for half i given.
Note that system is having more than 1000 line items to display..
Regards,
R. Loganathan -
Issue with displaying QM control chart for specific date range
Dear All
In our chemical mfg organisation, we just implemented SAP QM solution and things are working fine. I have implemented control chart functionalities as below:
SPC Criteria in Inspection Plan: Task List Charateristics / Material (0020)
Sampling Procedure: Fixed Sample / SPC Inspection (without inspection point)
We use process orders to get the inspection lots for products (material) and record results for the MICs and UD the inspection lots.
Currently all our Control Chart have status 1 (created) and we have not moved any of those charts to status 3 and 5 yet.
Using QGC1 when user trying to run control chart for any particular material in the plant and for a specific date range, report showing all the charts for that material with different MICs as expected. Though the result is NOT restricted to the selection dates either against "Lot Created On" or " Insp. Start Date" ( may be due to SPC criteria????) , its always showing all the result for any particular MIC for that material starting from go live till today.
How to restrict the dispaly of result on the chart for any particular MIC against the Material / Plant within a specific date range ?
Looking forward for your response.
Best Regards
SKHi,
1. Even though when i give the Created on, and to date the system is displaying the report which is prior to the created on date.
2. Similarly the report data is different when the field is maximum no of Hits is given. for example when i giving this field as 10, 20, 30, etc the report is showing only 10 line items. if i enter 50, 60 etc it is showing the list for half i given.
Note that system is having more than 1000 line items to display..
Regards,
R. Loganathan -
Last Record Values for a given Date Range
Hi, I have a unique requirement to process/report only the values of the last record found in a date range for a given set of characteristics. The order would be by FISCPER.
For example: I have some data with 3 characteristics.
STORE001 MATN001 2004001 100 PCS
STORE001 MATN001 2004005 75 PCS
STORE001 MATN001 2004006 80 PCS
STORE002 MATN002 2003008 10 PCS
STORE002 MATN002 2004001 15 PCS
STORE002 MATN002 2004004 40 PCS
A selected date range of 2003008 to 2004001 would result in the following records being processed.
STORE001 MATN001 2004001 100 PCS
STORE002 MATN002 2004001 15 PCS
A selected date range of 2004002 to 2004006 would result in the following records being processed.
STORE001 MATN001 2004006 80 PCS
STORE002 MATN002 2004004 40 PCS
How can I accomplish this at runtime? Any ideas?Nope, it's not an inventory scenario. It could be say the last status of a gas meter within a selected date range.
Any other ideas?
I've considered using VKF, but haven't figured out how this would work yet. If I could modify the selected query data prior to query processing I might be able to number the records and then filter on that..... Anyway I'm open to any suggestions or leads!
I won't forget the points for anyone with a solution!
Thanks! -
Any FM to get count of each week day for the given date range
Hi guys,
Any FM to get count of each week day for the given date range?
eg: If i give 14/07/2008 to 14/08/2008
I need to find how many Mondays, tuesdays...sundays in this given date range.
If not single FM is available, any logic that gives above result is also appreciated.
Thanks,
Vinod.hi Vinod,
this is not a full solution, I just give you a basic idea:
DATA : lv_start TYPE sy-datum VALUE '20080714',
lv_end TYPE sy-datum VALUE '20080814'.
WHILE lv_start LE lv_end.
CALL FUNCTION 'FTR_DAY_GET_TEXT'
EXPORTING
pi_date = lv_start.
* IMPORTING
* PE_DAY_TEXT1 =
* PE_DAY_TEXT2 =
* PE_DAY =
* you have to summarize the output here somehow...
lv_start = lv_start + 1.
ENDWHILE.
hope this helps
ec -
Putting a specific date range in an SQL query
Hello team,
I have a query that i have to run every month but still i have to extract information for a given time period.
Please advise.SELECT gcard.ncrd as "CARD NUMBER",
GPCSTMER.TFNAMCSU || ' ' || TNAMECSU "CUSTOMER NAME",
TO_CHAR(GCARD.DISSUCRD,'DD-MM-YYYY') AS "FIRST ISSUE DATE",
case when GCARD.CRSVLCRD = '000' then 'VALID '
when GCARD.CRSVLCRD = '001' then 'LOST CARD '
when GCARD.CRSVLCRD = '002' then 'STOLEN CARD '
when GCARD.CRSVLCRD = '004' then 'FAULTY CARD '
when GCARD.CRSVLCRD = '005' then 'RETURNED CARD '
when GCARD.CRSVLCRD = '006' then 'STOP CARD '
when GCARD.CRSVLCRD = '007' then 'SUBSTITUTED CARD '
when GCARD.CRSVLCRD = '008' then 'CARD NOT ACTIVATED'
end "CARD STATUS ",
CASE
WHEN Gaccount.CSTATACT = '000' THEN 'NORMAL '
WHEN Gaccount.CSTATACT = '001' THEN 'GREYLIST '
WHEN Gaccount.CSTATACT = '002' THEN 'CLOSED '
WHEN Gaccount.CSTATACT = '003' THEN 'BLOCKED '
END "ACCOUNT STATUS",
TO_CHAR(GCARD.DEXPICRD,'DD-MM-YYYY') AS "EXPIRY DATE" ,
case when GCARD.CUTYPCRD = '001' then 'PRIMARY '
when GCARD.CUTYPCRD = '002' then 'AUTHORISED '
end "ACC TYPE"
FROM GCARD,GACCOUNT,GRACTCRD,GPCSTMER
WHERE GCARD.NCRD = GRACTCRD.NCRD AND
GCARD.NBIN = GRACTCRD.NBIN AND
GACCOUNT.NACT = GRACTCRD.NACT AND
GACCOUNT.NBIN = GRACTCRD.NBIN AND
GCARD.CRSVLCRD = 000 and
Gaccount.CSTATACT = 000 and
GPCSTMER.NCST = GCARD.NCST AND
GCARD.NBIN IN (515869) AND
PAN_INDEX_RANGE_ID = 50
ORDER BY GCARD.DISSUCRD,gcard.ncrd,PAN_INDEX_RANGE_ID;
This my whole query and when i extract the information i have for the whole range.. but me i want to input for a specific date range -
BW 3.5 - How can I select TADIR objects in a specific date range?
Hi everybody,
I have the necessity to obtain a list of BW objects in a specific date range. I have observed that using TADIR table it is impossible because a timestamp is not present. I have also the necessity to group the BW objects using the object type of the TADIR table (e.g. PROG for Program).
Any idea?
Many thanks in advance for your kind support.
Regards,
GiovanniHi Giovanni
I would suggest you try put table TADIR in SE11 and generating a "Where-Used List (CtrlShiftF5)" Also you should try double click on data element SOBJ_NAME in the database view of TADIR and generate a Where-Used List on that field, then you can see the relationships of the table/field.
I hope this works for you
Good Luck
Ben
Please Assign Points if Useful -
How to change bucket capacity for a certain date range (duration)?
Hi,
I need to update the bucket capacities of Resource at Vendor location in APO live cache for a particular period using BAPI_RSSRVAPS_CHANGEMULTI.
Here I am executing BAPI by passing -
Import Parameters:
LOGICAL_SYSTEM
COMMIT_CONTROL
PLANNING_VERSION
Tables:
RESOURCE_HEAD
(RESOURCE = Resource " Test123
LOCATION = Vendor Number/Loctaion
CAPACITY_A = 5000.000
NUM_OF_PERIODS = 001
PERIOD = 02 " Day Wise
UTIL_BUCKET = 100.000 )
RESOURCE_HEAD_X
(All corresponding fields X)
RESOURCE_QUANMODEL
(RESOURCE = Resource " Test123
VERSION = 01
ENDDA = 02/25/2011
BEGDA = 02/21/2011
QUANMODEL = 8000 )
RESOURCE_QUANMODEL_X
(All corresponding fields X)
[ I have a capacity variance:
Resource = Test123; Capacity Varient = 01; Valid From = 02/21/2011
Valid To = 02/25/2011; Bucket Util Rate = 100.000; Qty/Rate definition = 8000 ]
Now, while I execute /SAPAPO/RES01 to display Capacity for that resource-Location-PlanningVersion, Its showing that 'Bucket Capacity' and 'SNP Bucket Capacity' get changed into 5000. But this change happend for all the days and not only for the duration I passed into Bapi (From BEGDA to ENDDA).
How to change bucket capacity for a certain date range (duration)? Any help please.
Thanks
RoyI did it myself. Hence closing the thread.
Solution:
1. Get RESUID from /SAPAPO/RESKEY table by passing Resource as NAME.
2. Call Function Module /SAPAPO/CRES_QUANPROF_UPDATE
3. Call Function Module /SAPAPO/CRES_SAVE_FROM_BT
For further help, change manually a single record in the 'capacity profile' in TXN /SAPAPO/RES01 and debug both the FM mentioned above.
BR
Roy -
Ical searches with specific date range
We post the people who are to work at specific events in the notes field of ical. Is there a way to search for these peoples names on the web via ical.php within a specific date range? No matter what date I have set to look at on the calendar the search grabs everything in the past. I only want future events that this person is associated with. Thanks for helping if you can. Jake
Hi,
You want to run the report on specific date without 0CALDAY?. Without 0CALDAY you can't restrict the report for specific day. So you must insert 0CALDAY in report and then use Offsets or implement code in CMOD.
Thanks
Reddy -
Need to create a report to show values for a particular date range
I have to create a report, out of which I need two columns : << Customer Value Variance and Churn Score Variance >> to show values only for a custom date range, which will be entered via a dashboard prompt.
These generic date columns are not present and cannot be added. I have to make use of Pres variables
What I have currently done is:
1) Created a prompt with 2 different date columns and passing those values into variables vStartDate and vEndDate. (I don't actually need those 2 column which I have selelcted, but I have taken those so that I can prompt the values in calendar format and pass onto the variables)
2) Created report with necessary columns, with 2 extra columns (hidden) as vStart Date Column and vEnd Date Column which take the values from the presentation variables defined in the prompt. I have created these columns as then I can reference these in the two required columns if necessary.
I am already facing error in report after doing this and I am confused how to proceed. Any suggestions?
Thanks.Yes, but it only has one generic Date column, no start date and end date. I can't use that twice in the prompt. Although I can specify it to be 'between', but I'm not sure I can pass values to both variables like that.
Currently I have used Campaign Start Date and Campaign End Date to enter values in calender format to the variables. -
Deleting emails with in a specific date range
Is there a way to delete a specific date range of email using 10.9.3 or Gmail. Thanks
Try making a rule or a Smart mailbox to delete them.
Rules, Smart Mailboxes, and VIPS -
Name of users of a particular Tcode for a given date range
Hi experts,
I am making an alv where inputs will be
1> T_code(as parameter)
2> Date Range(as Select options)
I have to display the following fields:::
1> User name
2> Frequency of use the Tcode for the given Date range.
Please give me the tables where I can get the relation of those fields.
N.B. I know the transaction AL08 and SM04.But it won't solve my purpose.
Thanx in advance,
Sourav>
SOURAV PAUL wrote:
> Hi experts,
> I am making an alv where inputs will be
> 1> T_code(as parameter)
> 2> Date Range(as Select options)
by creating the report As per your this requirement you need not to create any Bulk on your SAP.Just use STAD/STAT transaction they are availabe for this purpose.
and more you may track by security log audit by SM20 get these details.
i'm worried about tables which sre storing these details. -
Min,Max for a time Range and Sum of Records for the last date/time
Hi All,
I have a table with the following structure/data:
create table Events (
[EventID]
int NOT NULL,
[Title]
nvarchar(200) NOT NULL,
[SourceName] nvarchar(20) NOT NULL,
[Type]
int NOT NULL,
[eDate]
datetime
insert into Events values(100, 'Event 1', 'S01', 3,'2014-01-01 00:00:00.000')
insert into Events values(100, 'Event 1', 'S07', 3,'2014-01-01 00:00:00.000')
insert into Events values(100, 'Event 1', 'S08', 3,'2014-01-01 00:00:00.000')
insert into Events values(100, 'Event 1', 'S09', 3,'2014-01-01 00:00:00.000')
insert into Events values(101, 'Event 2', 'S010', 3,'2014-01-01 00:00:00.000')
insert into Events values(102, 'Event 3', 'S03', 3,'2014-01-01 00:00:00.000')
insert into Events values(100, 'Event 1', 'S04', 3,'2014-01-01 00:00:00.000')
insert into Events values(101, 'Event 2', 'S05', 3,'2014-01-01 00:00:00.000')
insert into Events values(102, 'Event 3', 'S06', 3,'2014-01-01 00:00:00.000')
insert into Events values(100, 'Event 1', 'S01', 3,'2014-02-01 00:00:00.000')
insert into Events values(101, 'Event 2', 'S02', 3,'2014-02-01 00:00:00.000')
insert into Events values(102, 'Event 3', 'S03', 3,'2014-02-01 00:00:00.000')
insert into Events values(100, 'Event 1', 'S04', 3,'2014-02-01 00:00:00.000')
insert into Events values(101, 'Event 2', 'S05', 3,'2014-02-01 00:00:00.000')
insert into Events values(102, 'Event 3', 'S06', 3,'2014-02-01 00:00:00.000')
insert into Events values(100, 'Event 1', 'S01', 3,'2014-03-01 00:00:00.000')
insert into Events values(101, 'Event 2', 'S02', 3,'2014-03-01 00:00:00.000')
insert into Events values(102, 'Event 3', 'S03', 3,'2014-03-01 00:00:00.000')
insert into Events values(100, 'Event 1', 'S04', 3,'2014-03-01 00:00:00.000')
insert into Events values(101, 'Event 2', 'S05', 3,'2014-03-01 00:00:00.000')
insert into Events values(102, 'Event 3', 'S06', 3,'2014-03-01 00:00:00.000')
And I wrote the following query:
select EventID as [Event ID],
Title,
count(distinct(SourceName)) as [Instances],
Type,
min(eDate) as [First Detected],
max(eDate) as [Last Detected],
datediff(d,min(eDate),max(eDate)) as [Delta (days)]
from Events
where type = 3
group by EventID, Title, Type
having max(eDate) <> min(eDate)
and max(eDate) =(select top 1 eDate from Events order by eDate desc)
and I get the following results (see the instance number)
Event ID Title Instances Type First Detected Last Detected
Delta (days)
=============================================================================================================================
100 Event 1 5 3 2014-01-01 00:00:00.000 2014-03-01 00:00:00.000
59
101 Event 2
3 3 2014-01-01 00:00:00.000 2014-03-01 00:00:00.000 59
102 Event 3
2 3 2014-01-01 00:00:00.000 2014-03-01 00:00:00.000 59
This is normal for this query however what I need to do is a little different.
In other words, while I need to show when we recorded a specific event first and last time,
I need to display the results for the last date/time when it was recorded.
For example what I need to provide should look like this:
Event ID Title Instances Type First Detected
Last Detected Delta (days)
=============================================================================================================================
100 Event 1 2 3
2014-01-01 00:00:00.000 2014-03-01 00:00:00.000 59
101 Event 2 2 3
2014-01-01 00:00:00.000 2014-03-01 00:00:00.000 59
102 Event 3
2 3 2014-01-01 00:00:00.000 2014-03-01 00:00:00.000
59
Could you please help me to fix this query?
TIA,
John;With cte As
(Select EventID as [Event ID],
Title,
SourceName,
Type,
min(eDate) Over(Partition By EventID, Title, Type) as [First Detected],
max(eDate) Over(Partition By EventID, Title, Type) as [Last Detected],
eDate,
datediff(d,min(eDate) Over(Partition By EventID, Title, Type),max(eDate) Over(Partition By EventID, Title, Type)) as [Delta (days)],
max(eDate) Over() As MaxEDate
from Events
where type = 3)
Select [Event ID],
Title,
COUNT(Distinct SourceName) As Instances,
Type,
[First Detected],
[Last Detected],
[Delta (days)]
From cte
Where eDate = MaxEDate And [First Detected] <> [Last Detected]
Group By [Event ID],
Title,
Type,
[First Detected],
[Last Detected],
[Delta (days)];
Tom
P.S. Thanks for providing the DDL and data. That is always very helpful.
Maybe you are looking for
-
Why are my browsers (and app store) crashing?
First, some context. I got my iMac last year around July. It worked well. Upgraded to Mountain Lion and everything seemed ok. Yes there were crashes here and there but they were few and far between. Around November, I noticed that things began to get
-
Steps to upgrade dbconsole from 10.2.0.1 to 10.2.0.4
Hi All, I am using oracle 10gR2 base version - 10.2.0.1. My collegue has upgrade it to 10.2.0.4. So when I login to the database and check the comp_name,status and version it showing me 10.2.0.4 for all componets and from v$version it showing 10.2.0.
-
When I print a pdf document some of the lines of text are a lighter black than the rest of the copy. This only happens with pdfs and it isn't always in the same location on the page. Are there settings I'm missing?
-
Error: check your ApJServLogFile for details
When I start the apachectl , error : check your ApJServLogFile for details Pls help..thanks
-
Just upgraded all my apps are gone, all my game saves
I just upgraded to 5.0 like a moron and now all my apps, games, game saves, photo folder is missing, kindle, everything. If i dont get my data back im never spending another sent on a app again. Is the data on my desktop? Am i supposed to download