Last year-to-date figure
Hello Experts -
I'm using a customer exit variable to calculate the beginning of the year. And I have a variable input for a calendar month.
I'm using these two values to get the year-to-date figure.
How can I calculate the last year-to-date figure?
Thanks a lot in advance.
Thanks for the prompt replies.
I don't have a year so thats why i'm using a customer exit.
another thing is my calendar month is not the 0CALMONTH. i had to derive it from a timestamp. and its not a time characteristic which we can't create.
its a NUMC. and i think thats why the offset isn't working either.
Similar Messages
-
Till Last Year, To Date - Discoverer......
We have following table X
PNO Date Amount
10 10/31/2006 10
10 11/30/2006 15
10 11/30/2007 20
10 12/31/2007 30
10 1/31/2008 15
10 2/29/2008 25
10 3/31/2008 40
We need to create report as follows, the parameter is the Date.
Lets say user pass parameter : 3/31/2008
The report should look like,
PNO TillLastYear To date
10 75 155
Till Last Year - Sum of Amount column till Last Year
To Date - Sum of Amount Column to the date parameter passed.
Could some on guide me how to achieve this......?Hi,
You need to add the PNO item into your report and then create calculations based on your date item:
TillLastYear SUM(CASE WHEN DateItem < TRUNC(SYSDATE,'Y') THEN Amount END)
ToDate SUM(CASE WHEN DateItem < :DateParameter THEN Amount END)
Rod West -
afternoon all,
I am so confuse with these year to date dates, what is the best practice if you want to get all the dates from last year upto today's date.
For example, Today is 16/01/2009, so effectively the last year to date would be 16/01/2008 to 16/01/2009.
I am thinking of using =Today-365
or =Currentdate-365
or =(dateserial('y',-1,)
Perhaps you can give me some ideas?
Regards
JehanzebI forgot to ask another question. I am using the following formula under my Record Selection formula,
Does this formula means from Last year to date?
({lab_rework.rework_date} in date(year(currentdate),1,1) to
dateserial(year(currentdate), month(currentdate)+1,1)-1
Sorry but I am so confused with these date formulas.
The purpose is to get last year to date records, that is 16/01/2008 to 16/01/2009 where 16 is currentdate.
Regards
Jehanzeb -
To find last year's data / a particular year's data
Hi ,
How to find out the data for the entire last year , i tried like
entered_date between to_char( '12/31/2008 11:59:59', 'MM/DD/YYYY HH12:MI:SS')
and to_char('01/01/2010 00:00:00', 'MM/DD/YYYY HH12:MI:SS' ) , but it is an invalid number error.
thanks.Hi,
If you want something that doesn't require hard-coding a year, but automatically figures out what year it is:
WHERE entered_date >= ADD_MONTHS ( TRUNC (SYSDATE, 'YEAR')
, -24
AND entered_date < ADD_MONTHS ( TRUNC (SYSDATE, 'YEAR')
, -12
)There are a couple of things to notice about the expression you posted (besides using TO_CHAR instead of TO_DATE):
WHERE entered_date BETWEEN TO_DATE ('12/31/2008 11:59:59', 'MM/DD/YYYY HH12:MI:SS')
AND TO_DATE ('01/01/2010 00:00:00', 'MM/DD/YYYY HH12:MI:SS')BETWEEN includes both endpoints, so the expression above covers a tiny bit more than one year. It includes one second from 2008 and one second from 2010, as well as all of 2009.
Currently 2010 is the last year, so the expression you posted (as well as my suggestion) is actually for the year before last year, but it can easily be changed for any year. -
Last year column data not displying
Dear All,
I am working on one of reporting issue where data is not getting displayed for few Last year columns. I have checked at the back end and data is available in info providers.
I want your help to identify possible reason. I carried below trouble shooting steps.
1: checked data in back end and its available
2: all restrictions are proper.
3: there no issue with query properties, I check all.
I am doubtful about customer exit code so here it is. Please suggest me whether its good or not.
WHEN 'ZVAR_LYCW'.
IF I_STEP = 2.
CLEAR LOC_VAR_RANGE.
BREAK-POINT.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZVAR_CALDAY'.
CLEAR : L_S_RANGE,
v_loc_date,
v_loc_date1.
L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
L_S_RANGE-LOW(4) = L_S_RANGE-LOW(4) - 1. "low value previos year
L_S_RANGE-HIGH = LOC_VAR_RANGE-HIGH.
L_S_RANGE-HIGH(4) = L_S_RANGE-HIGH(4) - 1.
v_loc_date = L_S_RANGE-LOW. "take input value in another variable
v_loc_date1 = L_S_RANGE-HIGH.
L_S_RANGE-LOW = v_loc_date.
L_S_RANGE-HIGH = v_loc_date1. "high value = input, taken into another variable
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
endif.
Please help.
Thanks,
VishalHi vishal,
try this:
WHEN 'ZVAR_LYCW'.
IF I_STEP = 2.
CLEAR LOC_VAR_RANGE,L_S_RANGE,
v_loc_date,
v_loc_date1.
* BREAK-POINT.
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZVAR_CALDAY'.
v_loc_date = LOC_VAR_RANGE-LOW+0(4) - 1.
v_loc_date1 = LOC_VAR_RANGE-HIGH+0(4)-1.
L_S_RANGE-LOW = v_loc_date.
L_S_RANGE-HIGH = v_loc_date1.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
endif.
Edited by: JAIGUPTA on Jan 20, 2012 6:14 PM -
Assign Assets value date bydefault as last year doc date.
My scenario is :
Assets Purchased date is 01-02.2009(which comes in last year) & we are posting it today.
I keep default value date as doc date.
But it comes by default when i post in same fiscal yr.When i post with last yr doc date,then it takes today date as value date.
How to keep last yr doc date as value date?Thanks.
I have kept the rule as 3-prime & 4-Alternative.
Still i m not getting .
Posting date 01.07.2009
Document date : 01.02.2009
So i want Valie date as 01.02.2009.
I think this rule is applicable in same yr of Posting & Value date only.
When i use date within same yr then this rule getting apply,but when i used different fiscal yr then it takes Posting date as value date.
So how to Keep value date as doc dt( which is in last yr) ? -
Moving average price calculation based on year to date figures
Hello,
I've been working for months on the stock valuation at month end closing for the Finance department. We discover a situation where the moving average price is not calculated as we expected.
The situation is as follows:
2 purchase orders for the same material at different periods and with different purchase order prices
the invoice of the first pruchase order has been recorded after the good receipts of the 2 purchase orders with purchase price variance, good issues have been recorded between the good receipts and the first invoice receipt, therefore the stock quantity is lower than the quantity invoiced
the invoice of the second purchase order has been recorded as well with price purchase variance after the first invoice and after good issues, therefore the stock quantity is lower than the quantity invoiced.
Here is an example with figures:
SAP Calulation
Good entry
Good Issue
Before Posting
After Posting
Good receipt
Invoice receipt
Date
Movement
Quantité
Price
Value
Quantité
Price
Value
Quantité
Value
PMP
Quantité
PMP
Value
Quantité
PMP
Value
01.01.2014
Intial Stock
2000
11
22000
16.01.2014
Purchase Order 1
10000
10
100000
2000
11
22000
12000
10,17
122040
20.01.2014
Good issue
2000
20340
10,17
12000
10,17
122040
10000
10,17
101700
18.02.2014
Purchase Order 2
20000
9
180000
10000
10,17
101700
30000
9,39
281700
22.02.2014
Good issue
22000
9,39
206580
30000
9,39
281700
8000
9,39
75120
30.03.2014
Purchase Order 1
10000
9,5
95000
8000
9,39
75120
8000
8,89
71120
21.04.2014
Good issue
2000
8,89
17780
8000
8,89
71120
6000
8,89
53340
31.05.2014
Purchase Order 2
20000
7
140000
6000
8,89
53340
6000
6,89
41340
- When the first invoice is recorded, SAP calculate the MAP this way: ( 8000*9,39 + (95000-100000) * (8000/10000) ) / 8000 = 8,89
- When the second inoice is recorded, SAP calculate the MAP this way: ( 6000*8,89 + (140000-180000) * (6000/20000) ) / 6000 = 6,89
Moving average price calculation requirement
Good entry
Good Issue
Before Posting
After Posting
Good receipt
Invoice receipt
Date
Movement
Quantité
Price
Value
Quantité
Price
Value
Quantité
Value
PMP
Quantité
PMP
Value
Quantité
PMP
Value
01.01.2014
Intial Stock
2000
11
22000
16.01.2014
Purchase Order 1
10000
10
100000
2000
11
22000
12000
10,17
122040
20.01.2014
Good issue
2000
20340
10,17
12000
10,17
122040
10000
10,17
101700
18.02.2014
Purchase Order 2
20000
9
180000
10000
10,17
101700
30000
9,44
283200
22.02.2014
Good issue
22000
9,44
207680
30000
9,44
283200
8000
9,44
75520
30.03.2014
Purchase Order 1
10000
9,5
95000
8000
9,44
75520
8000
9,28
74240
21.04.2014
Good issue
2000
9,28
18560
8000
9,28
74240
6000
9,28
55680
31.05.2014
Purchase Order 2
20000
7
140000
6000
9,28
55680
6000
8,03
48180
- When the first invoice is recorded, SAP should calculate the MAP this way: (2000*11+10000*9,5+20000*9)/(2000+10000+20000) = 9,28
- When the second inoice is recorded, SAP should calculate the MAP this way: (2000*11+10000*9,5+20000*7)/(2000+10000+20000) = 8,03
Could you tell me if you know how to set up the calculation based on this formula (Intial stock value at MAP + Year to date Purchasing value) divided by (intial stock quantity + quantity purchased)?
Thank you in advance
RegardsArti,
MBEWH table will get you the MAP of a material monthwise,I guess you need to get the logic which will use those details to arrive on MAP for a paritcular date.
Check the SDN Forums with the keyword "MOVING AVERAGE PRICE REPORT" to get some lead.
moving average price report
K.Kiran. -
Dates -- Pulling the last year data!, which should'nt be the case.
Need some basic SQL Help ..
Iam supposed to pull the data based on a date column(end_time) -- Yesterday 3PM untill Today's 3PM.
Iam getting last year's data too in additon to Current Data.
Where am i comparing wrong??
SELECT a.*
FROM table a
WHERE TO_CHAR (a.action_end_time, 'MM/DD/YYYY HH24:MM:SS') >=
TO_CHAR (SYSDATE - 1, 'MM/DD/YYYY')
|| ' 15:00:00'
AND TO_CHAR (a.action_end_time, 'MM/DD/YYYY HH24:MM:SS') <=
TO_CHAR (SYSDATE, 'MM/DD/YYYY')
|| ' 15:00:00'
ORDER BY a.end_time;Date math, 1 = 1 day 1 / 24 = 1 hour, trunc with no date format gives midnight
Try this.
select a.* from table a where
a.action_end_time between trunc(sysdate) + (15 * 1 / 24)
and trunc(sysdate - 1) + (15 * 1 / 24) In your example you are comparing strings, not dates. -
Sales Summary - Compare same weekday sales last year.
Post Author: geoffh
CA Forum: Formula
I have a table storing invoices going back several years. I wish to calculate the total sales for yesterdays date, & compare it with total sales for the same weekday in the previous year. For example if it is Tuesday today, I need to calculate Mondays total sales (yesterday) & also Mondays total sales for the same week period last year.
Date fields I have available are 'history.date_invoiced' (invoice date) , history.week_invoiced , history_year.invoiced. Sales values are history.sell_account & history.sell_cash.
I'm new to crystal.......Using V 11.0.0.1282 . Any help would be greatly appreciated.Post Author: yangster
CA Forum: Formula
create a formula with the following informationnumbervar weeknumber_curr_year := datepart("ww", dateadd("d", -1, ));numbervar weekdaynumber_curr_year := datepart("d", , 1); //assuming sunday is the start date of the week, change to 2 if monday isthose 2 variables will tell you the current week number and what day of the week you are after for the current yearnumbervar last_year := dateadd("yyyy", -1, currentdate);if year() = last_year and datepart("ww", ) = weeknumber_curr_year anddatepart("d", , 1) = weekdaynumber_curr_year then amt_field else 0put that in the details section and create a summary of the formula and you should have the total sum of sales for exactly the same week and day of week one year prior to yesterdaymaybe kai has a more simplified solution but that's what comes off the top of my head -
I have a requirement where say user selects year and months by prompts eg. 2008 jan and 2008 feb. It should also give me sales for last year and should be arranged as rows.
2008 Jan Sales
2008 Feb Sales
2007 Jan Sales
2007 Feb Sales
How to go about it?
ThanksYou would need to expose another column (you can hide it, of course) that contains the month number (monthnum) equivalent (1 - 12) of the month name (Jan - Dec). Set primary sorting (1) to the year in descending order and secondary sorting (2) to the monthnum column in ascending order.
As for getting "last year's" data from the prompt, say you have a prompt called "Year." Then you would create two "year" filters, on the Year column, as follows:
"column name".year = @{Year}
OR
"column name".year = @{Year}-1
This will pull both the "prompt year" and the year before. -
Last Yr Plan Data Vs Current yr Plan Data
Hi gurus,
Cd some one tell me when we are into a situaion where need to compare Plan Values Vs Last Yr and Current Yr,
1. How we are going to do this.
2. How Versions will be differentiated?
3. Will be Plan Valus of Last Year still can be changed or else they will be in
Display Mode. For me it does not make sense to change Last Year Plan Data.
Thanks a lot for all your kind inputs.
Quick assistance is highly appreciated.
Regards,
BI-IP GuestHi ,
I think u can take a multiprovider on three cubes in which
1.)The last year content will be in the standard infocube (b'coz according to any business data can be changed within a particular time limit)
2.) The current year's content also u have to put in standard infocube
3.) The plan data u can put in real time infocube on which u can define aggregation level and planning function and sequences.
now u can report on the multiprovider by which u can compare the data on the respective three years.
Regards,
Supriya -
How to design for YTD, Monthly & Last year Key figures
Hi Gurus:
Can you pls tell me how to design a data model, where a user wants to get YTD, Monthly & Last year Key figures say Sales volume...
Is aggregates the answer?
Pls let me know...Thanks a lotHi Vijay,
I am a beginner in BI field.
I have a problem till now i couldnt get the right answer.
That the reason why i write you today.
My Problem is with a Query.
I'm designed a dynamic query which should look like this:
12.2005-- Jan06 --- Feb06 --- Mar06 --- Apr06 ... Dec06 --- YTD
My Problem, if you give per e.g Dezember, all Months have to appear. Or you give may, your going to receive till may.The result i receive till now its only the month i gave.How can i get the correct answer? How i am going to calculate the YTD?
You can directly answer hier:[email protected]
Thanks -
Hi All;
I have a field called createdon
Using this field i need to create the SSRS expression for the table as below
Any help much appreciated
Thanks
Pradnya07use expressions as below
assuming this is to be done in SSRS
Today
=COUNT(IIF(
DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now()),Fields!YourRequiredField.Value,Nothing))
Yesterday
=COUNT(IIF(
DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
LastWeek
=COUNT(IIF(
DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
Last fortnight
=COUNT(IIF(
(DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-1)
Or (DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-2),Fields!YourRequiredField.Value,Nothing))
Last Month
=COUNT(IIF(DateDiff(DateInterval.Month,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Month,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
Year To Date
=COUNT(IIF(DateDiff(DateInterval.Year,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Year,Cdate("01/01/1900"),Now())
And
DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) <= DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now()),Fields!YourRequiredField.Value,Nothing))
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to fetch year till date value for earning for current ,last and year
hi,
how to fetch year till date value for earning for current ,last and year before that from payroll result
plz reply soon,
pratyushDear Pratyush,
Pick this from CRT.
Use LDB PNPCE & Fire event GET PAYROLL &
then you can pick from CRT.
Hope this helps.
Kindly reward in case useful.
Regards & Thanks,
Darshan Mulmule -
Parameter for Last Week, Last Month & Last Year from the current Date
I have a crystal report that has a StartDate & EndDate parameters from the stored procedure that I am calling. Now i got a new requirement saying that my user wants a drop-down parameter in which they need to be able to select last week (Sunday to Saturday), last month, last year instead of manually selecting start date and end date parameters? Can anyone please explain me how to do this?
(FYI, I am using Crystal 2008)Hi Naveen,
You'll need to handle the logic in the Stored Proc's where clause.
If you're using oracle, I have something like this in the Stored Proc's where clause for our reports:
Where {Date_Field} Between
Decode('{?Relative Date}',
'Yesterday', sysdate - 1,
'Last Week', Tunc(sysdate, 'IW')-7)
AND
Decode('{?Relative Date}',
'Yesterday', sysdate,
'Last Week', Tunc(sysdate, 'IW'))
where 'Relative Date' is a prompt in the Stored Proc and 'yesterday'. 'last week' are the 'static values' in the prompt.
-Abhilash
Maybe you are looking for
-
I've asked a similar question to this on an Office Community Forum but nobody knows the answer. So I was hoping that an IT professional responsible for installing and deploying Office 2013 might know. If you download an installation disk image (ISO/
-
Insert into table a large amount of records
I was trying to find a fast way to optimize a script that insert a large amount of records into a table. The initial script was like insert into table_xxxx select a.camp1, a.camp2, a.camp3 a.camp4, b.camp1, b.camp2, b.camp3 from table_a a, table_b b
-
In Photoshop CS5, if I drag-and-drop an image from one document to another, it has suddenly started going to grayscale rather than RGB. Any ideas on what setting I screwed up would be appreciated rhg
-
Can we move SAP R/3 standard Function Groups, SAP Tables to BW
Dear Forum, We are in a pilot process of migrating SAP R/3 Custom development objects to our BW client and we have a few questions that we would like to know if possible. We are currently in the To Be Blueprint Phase of migrating SAP 45B to ERP20
-
HT1473 Why won't my mp3 music import to my iTunes Library?
I have been attempting to import my favorite mp3 tracks to my iTunes Library on my laptop ever since iTunes' icon became the musical stop sign I've started calling it with it's new red color and how my music never appears in the My Music playlist no