Last year value
I am having a table inv_sales_trgt_val and columns
branch_cd number(3),
vndr# number(3),
yymm number(6) ,
vgroup# number(3),
sales_trgt_amt number(11,2),
sales_actl_amt number(11,2),
cuml_trgt_amt number(11,2),
cuml_actl_amt number(11,2),
last_yr_yymm_amt number(11,2)
In report i need to get sum(sales_actl_amt) which is present year and sum(last_yr_yymm_amt) which is last year ,i am getting sum(sales_actl_amt) correct value but sum(last_yr_yymm_amt) getting different value .so from sales_actl_amt can i get last year value in report.
please help me
thank you.
Hi Joss,
In SQL Server Analysis Services, we can can compare revenue with the hierarchy periods (year, month, day) by using the PARALLELPERIOD function, and now you want to compare with custom periods. (NOTE: We cannot compare it with the PARALLELPERIOD function
since
PARALLELPERIOD function returns a member from a prior period in the same relative position as a specified member. So if the first time span not equal to the second one (such as the first period is 3 days, and the second period is 2 month)). Here
is a sample query about PARALLELPERIOD function for your reference.
with
set Hotels as
[Hotels].[Hotel ID].&[1015],
[Hotels].[Hotel ID].&[5640],
[Hotels].[Hotel ID].&[8800]
set Period as [Arrival Date].[Date].[Month].&[2012]&[1]:[Arrival Date].[Date].[Month].&[2012]&[12]
member [Arrival Date].[Date].[0] as sum({ Period })
member [Total Amount N-1] as (PARALLELPERIOD([Arrival Date].[Date].[Year], 1, [Arrival Date].[Date].[Year].&[2012]), [Measures].[Total Amount])
select
[Measures].[Total Amount],
[Measures].[Total Amount N-1]
} on 0,
nonemptycrossjoin
Hotels,
Hotels.[Hotel].children,
*{[Arrival Date].[Date].[0]}
} on 1
from [Booking_Cube]
Regards,
Charlie Liao
TechNet Community Support
Similar Messages
-
How to get the same period last year value using Fiscal Calendar?
Hi there,
I am using DAX in a Tabular Model project but I am getting stuck trying to get the following:
We are using a Fiscal Calendar (from 01 April to 31 March).
Previous Period Value
Value
2012
April
15
May
10
Jun
20
2013
April
15
30
May
10
20
Jun
20
25
I have tried to use sameperiodlastyear but there is an error saying that this function cannot be used for non contiguous dates. DATEADD is given the same error...
Could anyone help me getting the right measure expressions for [Previous Period Value]?
Thanks and best regards,
JossHi Joss,
In SQL Server Analysis Services, we can can compare revenue with the hierarchy periods (year, month, day) by using the PARALLELPERIOD function, and now you want to compare with custom periods. (NOTE: We cannot compare it with the PARALLELPERIOD function
since
PARALLELPERIOD function returns a member from a prior period in the same relative position as a specified member. So if the first time span not equal to the second one (such as the first period is 3 days, and the second period is 2 month)). Here
is a sample query about PARALLELPERIOD function for your reference.
with
set Hotels as
[Hotels].[Hotel ID].&[1015],
[Hotels].[Hotel ID].&[5640],
[Hotels].[Hotel ID].&[8800]
set Period as [Arrival Date].[Date].[Month].&[2012]&[1]:[Arrival Date].[Date].[Month].&[2012]&[12]
member [Arrival Date].[Date].[0] as sum({ Period })
member [Total Amount N-1] as (PARALLELPERIOD([Arrival Date].[Date].[Year], 1, [Arrival Date].[Date].[Year].&[2012]), [Measures].[Total Amount])
select
[Measures].[Total Amount],
[Measures].[Total Amount N-1]
} on 0,
nonemptycrossjoin
Hotels,
Hotels.[Hotel].children,
*{[Arrival Date].[Date].[0]}
} on 1
from [Booking_Cube]
Regards,
Charlie Liao
TechNet Community Support -
Hi BW Expert,
I have sales report the current primary volume is the CKF dispalying and i have problem last year primary volume is not dispalying . i tried using offset -1(fiscal year period) the values are not diplaying .Can any one suggest how to dispaly the last year values.
Regards
sivarajuHi,
As you have mentioned in post, there is problem with pervious year sales volume report. Are you looking data for entire year, in that case you should offset for fiscal year -1.
Also you are looking only for one period of pervious year, offset with -12 not with -1. If those restrictions are correct, check if you have fiscal year variant included in query. For offset to work proper you should have the fiscal year variant field in the query.
only then offset will work fine.
Hope this helps
Regards
Akhan -
To get last year Net Value by fiscal period
Dear experts,
Since yesterday am trying to get solution where still unable to succeed.The report requirement is that they need Planned sales and actual sales qty of current fiscal year/period wise and in first column to get last year Actual sales for same period.(Ex:009.2006 to 011.2006 is input and in first coloumn 009.2005 to 011.2005)
This is the situation:
I have kept restricted W2 for fiscal year varient in filter and have created quantity sales(for last year) RKF with variable as "From fiscal year/period-13 and To Fiscal year/period-1"(with offset) and have placed in Key Figure structure in column section.Above this Structure have kept Fiscal year/period info object with variable "From Fiscal Year/period to To Fiscal year/period.This is because i need period wise breakup.
I understand that above we have "From Fiscal year/period infoobject" and below that in key figure structure u have the above quoted key figure with quantity sales of previous year.I want period wise it has to show me last year(period wise) quantity with current year Planned aty and sales Qty
Have gone through all threads and now it feels that i should to for variable exit ?...Do i have any option apart from variable exit?...If so could anybody can provide code for the same...Kindly gimme solution.
Maximum points will be awarded..
Thanks and Rgds
ChandruHi,
I hope, you are entering values 009.2006 to 011.2006 for the variable "From Fiscal Year/period to To Fiscal year/period". Am I right?
If so, Donot restrict the fiscal year period with "From Fiscal Year/period to To Fiscal year/period like as you mentioned:--
<i>Above this Structure have kept Fiscal year/period info object with variable "From Fiscal Year/period to To Fiscal year/period.This is because i need period wise breakup.</i>
To get the break up Priod wise, taking Fiscal year period characterstics above the structure is sufficient with ou any restriction.
Under the characterstic fiscal year period take two KF (same kf called SALES QTY two times with different heading like " last year Actual sales" and "current year Actual sales ") . First KF will be restricted with customer exit varible on Fiscal year period characterstic. Second KF will be restricted with user entry varible on Fiscal year period characterstic.
In case if you enter the value 009.2006 to 011.2006 as the iput to user entry varible, the code should generate the value 009.2005 to 011.2005 to Customer exit varible.
With rgds,
Anil Kumar Sharma .P
With rgds,
Anil Kumar Sharma. P -
- How to Display Sales Qty & Value for This Year & Last Year in 2 Columns -
Dear All,
I'm having trouble in extracting the last year figures based date entered. I'm actually would like to create a query where I'm able to know the "TOP 10 item sold based item category". I've created a query, which show the top10 item sold (total quantity & value) for this year, but not able to display the last year figure (quantity). Please advise & thanks for your help and time.
SET ROWCOUNT 10
SELECT T1.ItemCode, T2.ItemName, T3.ItmsGrpNam, SUM(T1.Quantity) as "Total Qty Sold", SUM(T1.TotalSumSy) as "Total Amount"
FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
WHERE T0.DocDate >='[%0]' AND T0.DocDate <='[%1]' AND T3.ItmsGrpNam ='[%A]'
GROUP BY T1.ItemCode, T2.ItemName, T3.ItmsGrpNam
ORDER by SUM(T1.Quantity) DESC
I wish to have the output as follow
Item Qty (2008) Qty (2007) Value(2008) Value(2007)
A 300 150 1000 500
B 250 300 800 650
C 100 250 700 550
Currently, My results display:
Item Qty (2008) Value(2008)
A 300 1000
B 250 800
C 100 700
Cheers,
SereneHi,
if you want more flexible, you could try this modified Istvan's query:
SELECT top 10 T1.ItemCode, T2.ItemName, T3.ItmsGrpNam, SUM(T1.Quantity) as "Total Qty Sold",
SUM(T1.TotalSumSy) as "Total Amount" ,
(select sum (r.Quantity) from ODLN h
inner join DLN1 r on h.DocEntry=r.DocEntry
where h.DocDate>='[%4]' and h.DocDate<='[%5]'
and r.ItemCode=T1.ItemCode) '2007 Sold',
(select sum (r.TotalSumSy) from ODLN h
inner join DLN1 r on h.DocEntry=r.DocEntry
where h.DocDate>='[%6]' and h.DocDate<='[%7]'
and r.ItemCode=T1.ItemCode) '2007 Amount'
FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
WHERE T0.DocDate >='[%0]' AND T0.DocDate <='[%1]' AND T3.ItmsGrpNam between '[%2]' and '[%3]'
GROUP BY T1.ItemCode, T2.ItemName, T3.ItmsGrpNam
ORDER by SUM(T1.Quantity) DESC
Rgds, -
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) ? -
Last Year Asset Depreciation Value Does not Accumulate in Jan2010
Hi Experts,
One asset Capitalization and Depreciation Start date is same.
We Run the Depreciation up to last year the value is 800.
In Jan Depreciation is 100.
In Feb System is not Displaying the Accumulated Balance in Asset Explorer. (800 + 100).
Please Advise me How can i get that accumulated Balance.The most tabs are based on yearly simulation In Feb System is not Displaying the Accumulated Balance in Asset Explorer. (800 + 100).
Have a look to the tab posted values -
Reduction of APC values uploaded last year
Dear Friends,
My client realized that last year during upload of Asset values, APC values were high and they want to reduce the APC values from This August, by Debiting Accumulated Depreciation Account. They also require that system should not re-calculate Depreciation for the past period. Requirement is to calculate depreciation on the reduced APC values. Please guide how to achieve this.Dear Bernhard,
Thanks for your quick reply.
Client do not want to post unplanned depreciation. By posting thru ABAA, unplanned depreciation can be accounted, which will get posted in the next Dep run. I also understand that thru ABAA transaction code NBV can be reduced.
But the issue is different. Let me explain again.
In the last Fiscal year, during upload APC values were uploaded with excess amount. Now, disregarding the Depreciation posted for the last one year, the client want to reduce APC values, by debiting Accumulated Dep account. With this there will not be any change of NBV. Client do not want recalculate Dep Values last year. The requirement is only to reduce APC values, by debiting the Accumulated Dep and keep the NBV intact.
Example as on 01 Jul 2014.
APC value of an asset : 3,375,000
Accumulated Dep ; -1,912,500
NBV : 1,462,500
To remove the excess APC values uploaded last year, client wants to post 675,000. by debiting accumulated Dep account. Now the values should be as follows:
APC value of an asset : 2,700,000 (3,375,000 - 675,000= 2,700,000)
Accumulated Dep ;-1,237,500(-1,912,500 +675,000= -1,237,500)
NBV : 1,462,500
Hence there shouldn't be any change in NBV.
Does any one come across this situation ? how to proceed. ? which T code and what is Trans type?
Regards,
Venu -
Getting last year column value from a single table
I am having the following columns in my table
BRANCH_CD
YYMM
VNDR#
VGROUP#
SALES_TRGT_AMT
SALES_ACTL_AMT
CUM_TRGT_AMT
CUM_ACTL_AMT
i need to get sales_actl_amt from this year and sales_actl_amt from last year from a single table
pls help
thank you
Edited by: 960991 on Nov 19, 2012 11:13 PMHi ashish,
but i can't use unions in my reports.
once view my query :
select t.branch_cd,b.branch_e_name,t.vndr#,v.vndr_name,
sum(nvl(t.sales_actl_amt,0)) sales_actl_amt
from inv_sales_trgt_val t,branches b,vendor v where
t.branch_cd=b.branch_cd and
t.vndr#=v.vndr# and
(t.yymm between :fiscal_month and :fiscal_month2) and
(:fiscal_month<>trunc(:fiscal_month2,-2)) and :fiscal_month2<>trunc(:fiscal_month2,-2)) and t.branch_cd between :from_branch and to_branch and
t.vndr# between :from_vndr and :to_vndr
group by t.vndr#,v.vndr_name,t.branch_cd,b.branch_e_name
order by t.vndr#,t.branch_cd;
how can i get last year sales_actl_amt . -
How to calculate the sales in the last month of last year
Hi all,
I have a requirement need to implement ,
the report has three columns,
MONTH----SALES----SALES2
201201----10------------100
201202----20------------100
201203----30------------100
201204----40------------100
201205----50------------100
The Sales2 is the sales of last month of last year, that is sales in 201112, value is 100.
How to realize this requirement ?
thank you in advance!!!sorry,
I think you maybe not understand my requirement.
What I want to implement as follow,
MONTH----SALES----SALES2
201201----10------------100 (This is 201112's Sales)
201202----20------------100 (This is 201112's Sales)
201203----30------------100 (This is 201112's Sales)
201204----40------------100 (This is 201112's Sales)
201205----50------------100 (This is 201112's Sales)
201206----60------------100 (This is 201112's Sales)
If I set SALES2 =AGO(SALES,MONTH, <number of period>)
how can I set <number of period> ?
201201 should mapping to 201112
201202 also mapping to 201112
201203 also mapping to 201112
201204 also mapping to 201112
201205 also mapping to 201112
201206 also mapping to 201112 -
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 -
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 -
We have a report that summarises monthly sales & credits for 2 years in a group footer. The footer is a sum of a formula in the detail section that calculates the monthly sales at the Item code level
Item 1
Group Footer 1 July Aug Sept Oct
Sales Last Yr @July_LY_Sales @Aug_LY_Sales @Sep_LY_Sales @Oct_LY_Sales
Credits Last Yr @July_LY_Credits @Aug_LY_Cred @Sep_LY_Cred @Oct_LY_Cred
Sales This Yr @July_CY_Sales @Aug_CY_Sales @Sept_CY_Sales @Oct_CY_Sales
Credits This Yr @July_CY_Cred @Aug_CY_Cred @Sep_CY_Cred @Oct_CY_Cred
<Curr Yr Graph1>
<Last Year Graph2>
Item 2
Group Footer 1 July Aug Sept Oct
Sales Last Yr @July_LY_Sales @Aug_LY_Sales @Sep_LY_Sales @Oct_LY_Sales
Credits Last Yr @July_LY_Cred @Aug_LY_Cred @Sep_LY_Cred @Oct_LY_Cred
Sales This Yr @July_CY_Sales @Aug_CY_Sales @Sept_CY_Sales @Oct_CY_Sales
Credits This Yr @July_CY_Cred @Aug_CY_Cred @Sep_CY_Cred @Oct_CY_Cred
<Curr Yr Graph1>
<Last Year Graph2>
In the footer under the data, we want a 4 line graph (or 2 x 2 line graphs for this year & last year). One line for sales for the current 12 months, and with it, a line plotting the credits, so as to see the trend over that year. And then we want a line graphing the previous years sales and a line graphing the previous year credits for the 12 months.
On the data tab in chart expert, we selected the Place chart for each SHDOC.ITEM (Item number) in the footer and this is positioning correctly. We have tried selecting "On change of shdoc.item and we have also tried For each record. We selected on change of shdoc.item to generate the graph for each item. We then added the 12 formula for the current year in the Show Value panel
In the show value panel we tried using the detail formula, the Report Area: Sum of <formula> and the Group 1: Sum Formula. They all display as @July or @Aug which is a dependent formula used to identify the month
We have added the above formula for each month and each value, but we can't work out how to group the monthly data into the 4 series of 4 lines (1 colour each) - Current Year Sales, Current Year Returns, Last Year Sales, Last Year Returns for the charting. We have tried to create a graph with only 1 set of monthly data (viz, just 12 months current year sales) But no matter what options we take, we seem to get 12 line chart representing each month rather than 1 line representing 12 months.
Can someone point us in the right direction?Please re-post if this is still an issue but search forums first, lots of chart questions have been answered.
-
Payment budget not checked in MIGO against last years PO
We are using Former Budgeting. We have customised specific tolerance (OF23) to generate error message when budget exceeds 100% against payment budget. (not commitment budget).
Now we have a scenario: Purchase order was created in the last year. Good was received in the current year. There is no budget against the commitment item in the relevant fund center. I expect the system to throw error messsage and stop good receipt posting. However, system does not give any message and goods receipt is posted. I would like the system to stop processing of goods receipt.
Appreciate any help in this regard
Cheers
RaghuveerHello Ajay
Thanks for your reply. I could not get back in time since I was on holiday.
We do not carry specifically execute carry forward of PO commitments step (PMJ2). System automatically carry forward the commitment. Question is not about the commitment budget. We have configured the system to give error message only when the payment budget is exceeded not at the time commitment. Because the budgeting is done based on payments (actual receipt of goods).
For example:
Fund center budget : 2013 1000
2014 100
PO created in 2013 for 800.
Good receipt in 2013 for 600.
In 2014 good receipt done for 200 (remaning value of PO). I expect the system to give error message for payment budget since 200 is more than the budgeted amount of 100. However, no messages are issued and GR is posted.
Appreciate if you can throw some light on tis.
Thanks.
Cheers
Raghuveer -
Line Chart to Compare Current Year vs Last Year
I am on BI 7 SP9. I need to create a line chart that shows 2 lines to compare revenue for the current year against last year. The first line should show the revenue for the current year. The second line should show the revenue for last year. In my BEx query, I have the fiscal period values in the row and the revenue key figure in the column. Questions:
1. How can I show 2 lines in the chart to compare revenue for the current year vs last year?
2. There are 2 variables for the fiscal period - one for current year and one for last year. The user can enter any value range in the fiscal period variables at query runtime, but the fiscal periods for each of the 2 years must be the same. This means the number of fiscal periods that appear in the query result rows will vary (e.g.. 3 periods for a quarter or 12 periods for a full year). The user has to enter the same fiscal periods for the current year and last year variables. How can I determine the fiscal period values to plot in the line chart for the current year and then last year when the number of rows in the query results will fluctuate?
The legend at the bottom of the chart should show JAN, FEB, MAR...DEC instead of the fiscal period values like 001/2007, 002/2007. Is there an exit I have to change to get this to work?
Thanks for any help you can give!You can do it in multiple ways
1.
SELECT COALESCE(t1.Company,t2.Company) AS Company,
COALESCE(t1.Sales2015,0) AS CurrentYearSales,
COALESCE(t2.Sales2014,0) AS PriorYearSales
FROM Sales2015 t1
FULL JOIN Sales2014 t2
On t2.Company = t1.Company
2.
SELECT Company,
MAX(CASE WHEN YearVal = 2015 THEN Sales ELSE 0 END) AS CurrentYearSales,
MAX(CASE WHEN YearVal = 2014 THEN Sales ELSE 0 END) AS PriorYearSales
FROM
SELECT Company,Sales2015 AS Sales,2015 AS YearVal
FROM Sales2015
UNION ALL
SELECT Company,Sales2014 AS Sales,2014
FROM Sales2014
)t
GROUP BY Company
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
Maybe you are looking for
-
Problem with display of JScrollPane
I have made a small GUI. It has a JFrame and four JPanels are added to the frame. The placement is done by program and hence layout manager is set to null. Two of the panels contain JScrollPane. One scroll pane is associated with a JList. Another scr
-
Sync multiple iPhones and iPod Touch's to one PC
I am going to have one iPhone 4 32GB and two iPod Touch 8GB's with one PC. I read up on how to sync different playlists to each device. However, I am unclear on how to sync different Apps to each device. The iPods I will have are much smaller capacit
-
Parroll report problem for court table.
Hi all, I have problem for payroll report that to court table .i new to working in payroll repors.here i given my criteria what i want output field. I am taking fields from pa0070. in this infotype i am taken thisd fields. PERNR LIKE PA007
-
Deifferent results!!
Hi all, why this is happening?when i put date clause in where it shows me nothing(i know that the order is booked yesterdaye(even the column of the row has yesterday's date)) and without it ,it has evrything in it... [email protected]>select * from c
-
Live theatre productions (hardware&software)?
What is the best Macintosh for use in live theatre productions (sound effects, lighting control, etc)? What is the best hardware/software configuration?