Date range Comparison to Period
Hi Guys
I have a selection screen date range. I want to select the agreements from a table whose Period is within the selection screen date range . what is the most appropriate way of compairing a period fied with date range??
Thanks in Advance
Harkamal
Hi , u can try FM like this
MM_ARRANG_SPMON_RANGE
regards
Prabhu
Similar Messages
-
Date range From Fiscal period range
Hi All,
How can we get the date range for a given fiscal period range?
please help.
Thanks
Gaurav Mittalhi
good
pls check this code
declare a range like
ranges: r_date for s021-spmon. (declare as per your data type for the date)
in initialization event write.
r_date-low = '012007'. (enter the required lower range of value)
r_date-sign = 'I'.
r_date-option = 'BT'.
r_date-high = '122007'.
append r_date.
now use the r_date field in the program code.
thanks
mrutyun^ -
I have payment table like this,
Date | Store | payment
01/01/2012 | A | $300
01/01/2012 | B | $400
01/01/2012 | C | $500
01/02/2012 | A | $500
01/22/2015 | C | $300
I want to make a report like this,
A
B ........ Totals
Current year | Last Year | Difference Current year | Last Year | Difference ..... Totals
Jan
Feb
March
Dec
However for comparing last year & current year, I only want to take into account the number of days in the current month. For instance, if current year-month sales are only up-to-date until 22 then for previous year, i want to show sales for Jan only
until 22.
I know I can hardcode this for previous year sales by specifying harcoded dates, but anytime I try using something like calculate(sum(payment), formula to calculate last date in current year and use dateadd() formula move this back by one year) always
results in error like "cannot use formula in calculate filter"
is there any solution to this?PaymentYTD:=CALCULATE(SUM([Amount]),DATESYTD(Dates[Date],"12/31"))
PaymentPriorYear:=CALCULATE([PaymentYTD],
SAMEPERIODLASTYEAR(Dates[Date]))
The dates in Dates tables are contiguous, however there are missing dates in payment table (as the store for closed for some of the holidays). Below
is sample data,
PAYMENT_DATE
AMOUNT
STORENO
PAY_DATEKEY
01/02/2014 9:51
$359.00
1
01/02/2014
01/02/2014 10:08
$283.00
1
01/02/2014
01/02/2014 10:09
$497.00
1
01/02/2014
01/02/2014 10:23
$494.00
1
01/02/2014
01/02/2014 10:34
$27.00
1
01/02/2014
01/02/2014 10:34
$63.00
1
01/02/2014
01/02/2014 10:56
$453.00
3
01/02/2014
01/02/2014 10:56
$175.00
3
01/02/2014
01/02/2014 10:59
$197.00
1
01/02/2014
01/02/2014 11:00
$145.00
1
01/02/2014
01/02/2014 11:01
$373.00
3
01/02/2014
01/02/2014 11:06
$475.00
1
01/02/2014
01/02/2014 11:10
$413.00
2
01/02/2014
01/02/2014 11:11
$431.00
2
01/02/2014
01/02/2014 11:13
$131.00
2
01/02/2014
01/02/2014 11:16
$34.00
2
01/02/2014
01/02/2014 11:16
$59.00
2
01/02/2014
01/02/2014 11:17
$203.00
1
01/02/2014
01/02/2014 11:19
$80.00
1
01/02/2014
01/02/2014 11:27
$418.00
1
01/02/2014
01/02/2014 11:27
$198.00
1
01/02/2014
01/02/2014 11:28
$354.00
2
01/02/2014
01/02/2014 11:29
$19.00
2
01/02/2014
01/02/2014 11:33
$425.00
3
01/02/2014
01/02/2014 11:34
$296.00
2
01/02/2014
01/02/2014 11:34
$302.00
1
01/02/2014
01/02/2014 11:35
$244.00
3
01/02/2014
01/02/2014 11:35
$13.00
3
01/02/2014
01/02/2014 11:39
$419.00
2
01/02/2014
01/02/2014 11:43
$144.00
2
01/02/2014
01/02/2014 11:43
$206.00
2
01/02/2014
01/02/2014 11:47
$194.00
3
01/02/2014
01/02/2014 11:48
$479.00
3
01/02/2014
01/02/2014 11:53
$20.00
1
01/02/2014
01/02/2014 12:06
$419.00
1
01/02/2014
01/02/2014 12:15
$129.00
1
01/02/2014 -
Date range parameters are off by one day
I have a Start Date and End Date parameter in my SSRS report. The results are off by 1 day. For example if I enter 4/2/2015 and 4/20/2015 it will return a few results from 4/1/2015 to 4/19/2015. I think maybe it's a problem with my date
conversion in T-SQL, but thought someone more experienced than me would have seen this before.
ThanksYes
The safest way to write a date range comparison would be as below
WHERE DateField >= @StartDate
AND DateField < DATEADD(dd,1,@EndDate)
If you want results with @EndDate inclusive
see more details here
http://visakhm.blogspot.ae/2012/12/different-ways-to-implement-date-range.html
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
ACI - Date Range issue for Sales Details report
I am working on ACI setup for one of my client. I set everything us as per documentation.
This is regarding ‘Sales Details’ (Public Folders > ATG > Commerce > Sales > All Sales) report.
Report is being generated if I select ‘Date Range’ under ‘Time Period’; but if I select ‘Predefined’ I get below errors:
RQP-DEF-0177
An error occurred while performing operation 'sqlPrepareWithOptions' status='-9'.
UDA-SQL-0107 A general exception has occurred during the operation "prepare".ORA-32035: unreferenced query name defined in WITH clause RSV-SRV-0042 Trace back:RSReportService.cpp(758): QFException: CCL_CAUGHT: RSReportService::process()RSReportServiceMethod.cpp(239): QFException: CCL_RETHROW: RSReportServiceMethod::process(): promptPagingForward_RequestRSASyncExecutionThread.cpp(774): QFException: RSASyncExecutionThread::checkExceptionRSASyncExecutionThread.cpp(211): QFException: CCL_CAUGHT: RSASyncExecutionThread::run(): promptPagingForward_RequestRSASyncExecutionThread.cpp(824): QFException: CCL_RETHROW: RSASyncExecutionThread::processCommand(): promptPagingForward_RequestExecution/RSRenderExecution.cpp(593):
Has anybody come across this issue?
Any help in this regard will be highly appreciated.
Thanks,
MukeshContact Oracle support. I think we've seen this one before if using a particular version of Oracle(11.1?). There's a particular version of Oracle that doesn't support queries in a WITH clause that aren't referenced in the main query. Cognos seems to generate these types of queries not knowing that the version of Oracle doesn't support it. According or Support Article ID 1063400.1 you can patch this particular problem with Oracle or you can upgrade to Oracle 11.2. I also think that was a to get Cognos to generate an alternative query that doesn't use the WITH clause at all. Something about disabling the use of WITH in all queries by making a change to the report definition or alternatively a global change to the metadata model.
Good luck...
Andrew -
Function module for getting periods for date range
Hi,
Can anybody tell me the function module which will return the periods along with the year, when we give a date range.
e.g
01011999 to 120112000
so it shoud return peroids between these date with year. Its possible thru programatically, but i m checking if there is any FM, so i can use FM.
Thanks,Hi,
You can use function module which works exactly what you are expecting FIMA_DAYS_AND_MONTHS_AND_YEARS.
please reward points to useful answers.
Thanks,
Sriram Ponna. -
How to translate dashboard prompt year/period into literal date range
I am using OBIEE 10g. I have a dashboard that prompts for a fiscal year and fiscal period (both are numeric data types). I need to use these values in the date filter for my answers request - however, to fully utilize the indexes and partitioning that have been set up on my fact table (Teradata database) I need to be able to convert fiscal year/period to a literal date range and pass literal date values (i.e. 10/01/2011 - 10/31/2011) to my answers filter. So far I have been unable to do this, I'm hoping someone has some ideas.
Here are some things I've tried so far:
In the dashboard prompt, set variables var_year and var_period (which would be set to 2012 and 10, respectively). Create a filter on my answers request for Date (from calendar dimension) that calculates a min/max date value based on var_year and var_period. While this works to return data, the sql is not optimized as it does not contain literal date values for the filter (10/01/2011 - 10/31/2011).
Create a subreport that takes the year/period from the dashboard prompt and calculates 2 columns, one for the "From Date" (using min calculation) and one for the "To Date" (using max calculation). Then create a filter on my answers request that uses the results of this subreport to create the date filter. Again this works - however, instead of passing the literal date values for from and to dates, it passes the min/max calculations so that these are executed again in the answers request sql. Therefore again this is not optimized, as it is not passing literal date values for the filter.
I have only been able to get this to work by creating a prompt for entering a from and to date directly, and using this to pass to the answers request filter. This generates optimized sql as it contains literal date values. However, this is not acceptable to the users as they want to enter fiscal year/fiscal period at the dashboard prompt, not a date range.
I have tried to get the fiscal year/fiscal period columns in the dashboard prompt to set another dashboard prompt for a date range, thinking I could then set new presentation variables for those from/to columns to use in the answers request, but I can't figure out how to do this. Is this even possible, to use a dashboard prompt value to set a subsequent dashboard prompt value?
Is there some other method of converting these prompt values to literal dates that I am missing?
Thanks in advance for any help you can provide.
RhondaDisregard. I gave up and just brought in the Fiscal Period Start Date and Fiscal Period End Date to the rpd so I can use them in the dashboard prompt, created presentation variables for each, and used those in the report filter.
-
How to get the date range for a given fiscal period.
Hi All,
There is two fields (select options) on my selection screen
1. Fiscal Year
2. Fiscal Period.
I just want the date range between the given year and period on selection screen.
Thanks,
Gaurav MittalCheck FM's FIRST_DAY_IN_PERIOD_GET and LAST_DAY_IN_PERIOD_GET.
-
How to get XLR to show BPs with no transaction data for a given date range
Hi -
I am building an XLR report that does a comparison of net sales data across two periods for a given sales employee's BPs.
The report has the row expansion:
FACT BPA(*) SLP(SlpName = "ASalesPersonNameHere") ARDT(Code = "ARCreditMemo", "Invoice") Group by BPA.CardName
and column expansions:
FIG(SO_TaxDate = @StartDate:@EndDate)
and
FIG(SO_TaxDate = @StartDate2:@EndDate2)
where @StartDate, @EndDate, @StartDate2, @EndDate2 are parameters that define the two ranges of dates.
The column formulas are, from left to right:
=ixDimGet("BPA", "CardName")
=ixGet("SO_DocTotal") <-- filtered by column expansion for first date range
=ixGet("SO_DocTotal") <-- filtered by column expansion for second date range
The report works fine except for one problem, I would like it to include BPs for which no transaction occurred in either date range as well.
Any help is greatly appreciated!
Thanks,
Lang RileyReally appreciate your feedback! Those are good suggestions. I should have mentioned that I had already tried both those suggestions.
Removing FACT on BPA in this case ends up returning all the BPs and not respecting the SLP(SlpName = "aName") part of the query.
Using **, i.e., * or #NULL, makes no change in the resulting data in this case. I had thought that ** would be the solution, but it didn't change the outcome. I still have BPs for which when their sales employee is used as the filter and they have no transactions for either date range, and yet they still do not appear.
I should further mention that the IXL query, as it now stands, does return BPs for which one of the periods has no data, just not both, and I have verified that applicable BPs with no transaction data for both periods do exist in my data set. It seems that perhaps the IXL query needs to be restructured? Please keep the suggestions coming including how this query might be restructured if necessary. -
Passing a date range to a Crystal Report using OpenDocument
Hi,
I am trying to call up a Crystal report in InfoView using a hyperlink with the OpenDocument function call.
It is working fine with the following URL:
http://<server name>:<port>/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=ARcnOcErTA1FidjRJ_sT0Yw&sType=rpt&sRefresh=Y&lsSCompany+Code=1300&lsMCost+Center=[12345],[67890]&lsSCost+Element=0000100123
However, once I added the date range into the parameter string, like this:
http://<server name>:<port>/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=ARcnOcErTA1FidjRJ_sT0Yw&sType=rpt&sRefresh=Y&lsSCompany+Code=1300&lsMCost+Center=[12345],[67890]&lsSCost+Element=0000100123&lsRFiscal+Year+Period=[Date(1,1,2011)..Date(1,9,2011)]
It returns an error message, "An error has occurred: java.util.Date ", to my browser.
I am wondering if I am missing any Java library or Java class path.
Any thoughts are appreciated.
Joyce
Edited by: Joyce Chan on Aug 30, 2011 12:25 PMHow do I check if the parameter passing in is in date type?
the following is exactly what I've tried:
&lsRFiscal+Year+Period=[Date(2010,10,10)..Date(2010,10,15)]
Would the error message be logged in the server, maybe I can find more information for the error log? -
Hi,
My end user requires me to develop a report that will accept the following parameters:
Customer Code : ABC
From Period : 01-Jan-2005
To Period : 31-Dec-2010
Output must be as follows :
Customer Jan-05 Feb-05 Mar-05 Apr-05 May-05 ......................................Dec-10 Total Order
Code
ABC 10 15 5 20 10 ...................................... 15 X value
I have told my end user that it is not possible to create an Oracle report that will give data for any period range that the user specifies. First the number of columns for the date range must be fixed like say at a time only data for 12 months will be displayed in the report. Then they can run the report for any year and the parameter has to be
Customer Code : ABC
Year :2005
The output will be :
Customer Jan-05 Feb-05 Mar-05 Apr-05 May-05 ......................................Dec-05 Total Order
Code
ABC 10 15 5 20 10 ...................................... 15 X value
Am I right or wrong ? Please advise. This is very urgent.I don't see why this should not be possible.
Remember that you can have repeating frames in every direction (ie. right and down) and can combine these.
What I would do is look for (or create) a type of calender-table where I could select the date values from (ie. JAN 05) qualified by the from- and to-Parameters (aka query1),
then have a second, dependent query which uses the date from the calender (aka query2).
Then stack a down repeating frame for query2 into the right repeating frame for query1 and you should be almost there... Use the date from query1 as heading...
Cheers,
Jens Rettig -
Date Range - Delete ZERO Values
Hi All,
Few days back I had posted Query Regarding Date range where in I enter Proj# from_month, from_year, To_month and To_year.
The output data for the project must be within this year range.
suppose I enter proj no. 13381 and
from_month - 05
from_year - 2004
To_month - 04
from_year - 2005
This is the Desired Output:
yearmonth plan14
200406 -
13381 -
100
200407 -
13381 -
100
200409 -
13381 -
678
Right Now the Output what Iam getting is:
yearmonth plan14
200405 -
13381 -
0
200406 -
13381 -
100
200407 -
13381 -
100
200408 -
13381 -
0
200409 -
13381 -
678
I Just want the NON ZERO PLan14 values. The PLan14 values with '0' should be deleted .
Below is the Jist of the code.
RANGES: S_GJAHR FOR COSP-GJAHR,
R_YEAR FOR COSP-GJAHR,
R_DATE FOR PROJ-ERDAT,
R_MONTH FOR CKML1-POPER,
S_OBJNR FOR COSP-OBJNR,
S_KSTAR FOR COSP-KSTAR.
DATA: MNT_INDX(20) TYPE C,
HLD_INDX(3) TYPE N.
DATA: W_MTH(2) TYPE N,
W_DATE LIKE PROJ-ERDAT.
DATA: BEGIN OF ITAB_OUT_TYPE,
PERIOD(10) TYPE C,
PROJDEF(20) TYPE C,
PROJ_TITLE(20) TYPE C,
STATUS(20) TYPE C,
PROJECT_TYPE(20) TYPE C,
START_DATE(20) TYPE C,
FINISH_DATE(20) TYPE C,
CONTRACT(20) TYPE C,
CLIENT(20) TYPE C,
PLAN14(25) TYPE C,
END OF ITAB_OUT_TYPE.
DATA ITAB_OUT LIKE ITAB_OUT_TYPE OCCURS 10 WITH HEADER LINE.
FIELD-SYMBOLS <FS>.
PARAMETERS FR_MONTH(2) TYPE N OBLIGATORY.
PARAMETERS FR_YEAR(4) TYPE N OBLIGATORY.
PARAMETERS TO_MONTH(2) TYPE N .
PARAMETERS TO_YEAR(4) TYPE N .
DATA: W_TXT(20) TYPE C.
R_YEAR-LOW = FR_YEAR.
R_YEAR-HIGH = TO_YEAR .
R_YEAR-OPTION = 'BT'.
R_YEAR-SIGN = 'I'.
APPEND R_YEAR.
concatenate FR_YEAR FR_MONTH INTO R_DATE-LOW .
concatenate TO_YEAR TO_MONTH INTO R_DATE-HIGH.
R_DATE-OPTION = 'BT'.
R_DATE-SIGN = 'I'.
APPEND R_DATE.
SELECT * FROM COSP
WHERE OBJNR = PRPS-OBJNR AND
GJAHR IN R_YEAR AND
KSTAR BETWEEN '0000400996' AND '0000400999' AND
VERSN = '014' AND
WRTTP = '01' .
DO 12 TIMES.
W_MTH = SY-INDEX.
CONCATENATE COSP-GJAHR W_MTH INTO W_DATE.
CHECK W_DATE IN R_DATE.
PERFORM CONVERT-DATE1 USING W_DATE.
MOVE HOLDDATE1 TO ITAB_OUT-PERIOD.
HLD_INDX = SY-INDEX.
CONCATENATE 'COSP-WKG' HLD_INDX INTO W_TXT.
ASSIGN (W_TXT) TO <FS>.
CLEAR ITAB_OUT-PLAN14.
ITAB_OUT-PLAN14 = ITAB_OUT-PLAN14 + <FS>.
APPEND ITAB_OUT.
enddo.
ENDSELECT.
I need all positive values of the month that are in the range. The Zero values must be deleted . How can i do that. PLease do let me know.
Thanks in advance
DanYou can do this easily just by deleting all records in one shot.
delete ITAB_OUT where plan14 = 0.
You can put that statement after the SELECT...ENDSELECT.
Or you can not even add them to the internal table at all. You can check before you APPEND to the table.
CLEAR ITAB_OUT-PLAN14.
ITAB_OUT-PLAN14 = ITAB_OUT-PLAN14 + <FS>.
<b>If itab_out-plan14 > 0.
APPEND ITAB_OUT.
endif.</b>
enddo.
ENDSELECT.
Regards,
Rich Heilman -
Hi Experts,
I have created a linked server to connect to mysql DB . The query is executing fine currently filter is based on the on going month.
The query actually fetches the records from 2 tables User and time sheet to find how many hours the users have .
Now we check the Hours for a period of 10th of the current month and 10th of the upcoming month .
So for now date range will be between 2014/10/05 and 2014/10/06. This logic i have implemented in the query .
Based on the query a report is generated which is sent out every Wednesday .Now suppose its 5th of June 2014 .
The query will fail because the date range is derived based upon
where cast(t.created_on as Date) > Concat(year(now()),"-",month(now()),"-","10")
AND cast(t.created_on as Date) <=Concat(year(now()),"-",month(now())+1,"-","10")
Please provide with a date filter like the report runs anytime the data is not affected. Like if the report is run in the
first week of a new month date range should be previous month Date 10 and current month Date 10 and if the report is run after 10th of the current month then the date range should be between 10th of current month and 10 of upcoming month . Kindly
help
Select * From
OPENQUERY
(Mysql,
'Select
Sum(t.hours),
Concat(u.firstname," ",
u.lastname) as Name
From mysql.time_entries t
Inner Join
users u
on u.id = t.user_id
where cast(t.created_on as Date) >
Concat(year(now()),"-",month(now()),"-","10")
AND
cast(t.created_on as Date) <=Concat(year(now()),"-",month(now())+1,"-","10")
Group By u.firstname,u.lastname
Union all
Select Sum(0) as hours,
Concat(firstname," ",
lastname) as Name
from users
where id not in(
Select
t.user_id
From mysql.time_entries t
Inner Join
users u
on u.id = t.user_id
where cast(t.created_on as Date) >
Concat(year(now()),"-",month(now()),"-","10")
AND
cast(t.created_on as Date) <=Concat(year(now()),"-",month(now())+1,"-","10"))
And firstname not in( "xyz")
GRoup by firstName,lastname'
goI recommend use CLOSED-OPEN dates rather than OPEN-CLOSED dates...
Hopefully this helps with your logic:
DECLARE @ReportDate TABLE
[ReportDate] DATE,
[mDay] AS DAY([ReportDate]),
[Beg] AS DATEADD(month, CASE WHEN DAY([ReportDate]) < 10 THEN -1 ELSE 0 END, [ReportDate]),
[End] AS DATEADD(month, CASE WHEN DAY([ReportDate]) < 10 THEN 0 ELSE 1 END, [ReportDate]),
[ReportBeg] AS DATEADD(month, CASE WHEN DAY([ReportDate]) < 10 THEN -1 ELSE 0 END, DATEADD(day, 10 - DAY([ReportDate]), [ReportDate])),
[ReportEnd] AS DATEADD(month, CASE WHEN DAY([ReportDate]) < 10 THEN 0 ELSE 1 END, DATEADD(day, 10 - DAY([ReportDate]) + 1, [ReportDate]))
INSERT INTO @ReportDate(ReportDate)
VALUES
('7-May-2014'),
('10-May-2014'),
('15-May-2014');
SELECT
CASE WHEN SYSDATETIME() >= [ReportBeg] AND SYSDATETIME() < [ReportEnd] THEN 1 ELSE 0 END
FROM @ReportDate; -
VL10h - 1 month default delivery date range
Dear Sirs,
I am using VL10h to create deliveries from Sales Order. But, The default date range it takes is only 1 month. Would you please suggest me to increase the date range?
The message I am getting is-
Latest deliv. creation date (04.12.2009) further in future than allowed (30 days)
Message no. V50R014
Diagnosis
Maximum future delivery time frame was exceeded.
System Response
In your system, the maximum delivery creation time frame is limited to 30 days in the future. However, you want to deliver until 04.12.2009, which the system does not allow.
Procedure
Choose a smaller interval for delivery.
Procedure for System Administration
You can set the number of days in the future the delivery is limited to in Customizing in Create deliveries profiles 0101, which is assigned to the current list profile "Sales Order and Purchase Order Items".
regards,
rahulDear Rahul
To avoid the error message V50R014 you have to change the value of the
field "Maximum delivery period in the future" (transaction VL10CUC). Alternatively, maintain the delivery creation profile in transaction VL10H for the field "Maximum delivery period in the future".
Hope this helps.
Regards
Tonia -
Date range for key date in hierarchy
Dear Friends,
Is there a work around for single key date restriction for time dependent hierarchy.Bcos i can only select one key date in teh report for my hierarchy so that it will take that hierarchy which falls in this date and display the result accordingly.
But is there a way to select the date range for key date so that more than one hierarchy can be used to display my report accrding to the time range.
Say,i have 4 hierarchies (time dependent) like v1,v2,v3,v4 and v5 for jan 08,feb 08,mar 08,apr 08 & may 08 respectively.
In my report,i want to display the result for the time interval say mar to May.
So my report should diplay the result according to the 3 different hierarchies for the time period i.e.v3,v4&v5.
How do i acheive this.
Thanks.
raguHi
I think we may do with the Char with text with replecement path.
take time char as Calmonth and set the offet value as -1 and -2 and design the report and use the hierarchies in that query.
Am not surt it willwork but better to try with this.
Maybe you are looking for
-
everytime i try to load an online java page, the java window says "error: click for details"... then a java console comes up saying: Java Plug-in 1.6.0_10-ea Using JRE version 1.6.0_10-ea Java HotSpot(TM) Client VM User home directory = C:\Users\stev
-
I am having troubles with iMessage on my iPod 5. I have iOS 8.2. It won't let me text just one person. I can text anyone else but this person. I send a message, and it just shows the red exclamation point and says "Not Delivered". I tap "Try aga
-
I really need help with my creative MuVo N200 mp3 pla
i got my MuVo N200 mp3 player for chirtmas of last year, and it stopped working in 3 months. it used to shut off every few minutes and the mic doesnt work any more and i cant record music from the radio. right now it doesnt even work for a minute, it
-
Security in iTunes and Match.
Hi All, A quick query on security within iTunes and something I have become increasingly wary about. I love iTunes match and the whole icloud thing, with close to 10,000 strong library now available in the atmosphere to multiple devices. As a result
-
Cannot Uninstall themes from my nokia 5800
I have a strange problem here. I recently installed some new themes into my phone. But now I cant delete the themes in anyway. I have tried application manager but when I try to uninstall it does nothing. Solved! Go to Solution.