Calculating Year to Date Totals
Develper advises they have no solution in Crystal for the following. Report requires display of monthly expenditure totals and a YTD total that represents the cummulative total of each month. The report displays a YTD total for the end of each month. Problem is that when a given month has a zero value for the monthly expenditure, the report is displaying a zero value for the YTD total and failing to pick up the YTD from the previous month end....
Does anyone understand the developer's issue and/or have a solution?
You should be able to group off year, month, put the field in detail section, then create a summary from
that field. Right click the field, select insert summary, and select the groups, or footers as needed.
If that does not work, you may need to try running totals.
Similar Messages
-
Monthtodate showing year to date totals
I have document all designed with crosstab, all i want it month to date totals and year to date totals. i have use existing formulas and the yeartodate one works, however, the monthtodate is displaying year to date totals on the report.
Can someone please help? I am farily new to Crystal.Thank you for responding Ian.
I am confused now, how will I get the Call types across the top if i don't use a cross tab?
Hardware Software Merchandise HR
1 MTD MTD MTD MTD
YTD YTD YTD YTD
2 MTD MTD MTD MTD
YTD YTD YTD YTD
3 MTD MTD MTD MTD
YTD YTD YTD YTD
4 MTD MTD MTD MTD
YTD YTD YTD YTD
This is what i have, but the MTD total is the same as the YTD total.
Or am i way off base?
Nita Kay -
Year to Date and Monthly totals
I know that this is rather simplistic, but I'm new to Discoverer and need to set up a bunch of sales reports with MTD and YTD columns. I'm going to be using the same SQL query for many of my reports but customizing the reports to show sales by state, product line, etc.
Is there a formula/function I can use in Discover for the Month to Date and Year to Date totals?
Thanks,
JosephHi Joseph
You can use the analytic range SUM calculation for these. For the month to date, use the a PARTITION BY of month with a range of all the preceding rows in the partition up to and including the current row. For the year, you would simply change the PARTITION BY to be the year.
Here are some examples drawn from my own database:
I have the following items:
ORDER_YEAR
ORDER_MONTH
ORDER_DATE
SELLING_PRICE
With these defined, the formula for month to date is:
SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS UNBOUNDED PRECEDING)
The formlua for year to date is:
SUM(Selling Price SUM) OVER(PARTITION BY ORDER_YEAR ORDER BY ORDER_DATE ASC ROWS UNBOUNDED PRECEDING )
Basically what we are doing is telling Discoverer to SUM the SELLING_PRICE, and you should be able to take these and adjust them for your own report.
Let me take a look at the month to end and describe what is going on. Basically the PARTITION BY is defining a set of rows which are to be included. In this case it is all rows that have the same ORDER_MONTH. The ORDER BY clause tells Discoverer to place the items in order, with the oldest order first. The ROWS UNBOUNDED PRECEDING tells Discoverer to SUM all of the items within the set (within the PARTITION BY) from the oldest item (UNBOUNDED PRECEDING) to and including the current item. We could have added a BETWEEN clause too but that is implied. With a BETWEEN clause it would look like this:
SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
If you want the current row to be included with UNBOUNDED PRECEDING you don't need to explicitly name it because that is the default. Other options you could use are these:
UNBOUNDED FOLLOWING - this SUMS to the end of the PARTITION
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING - you can guess that this will add all of the items, which you will rarely use because if you omit the ROWS command then this range between first and last is actually the default
Rather than ROWS BETWEEN you can also say RANGE BETWEEN, like this:
SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
I hope this little dissertation on running totals helps.
Best wishes
Michael -
How to get total or sum year to date or date range
Is there a way to duplicate in Numbers what I used to do with Excel's formula =DSUM(Database,"Total",Criteria) where criteria would be any date I plugged into a referenced cell to get a year to date total. Thanks! DBT
As described in the Help which offers a list of available functions(),
In cell B1 of Tableau 2, the formula is:
=SUMIF(Database :: B,A,Database :: C)
In cell B2 of Tableau 2 is an alternate formula which doesn't requires an auxiliary cell like A1
=SUMIF(Database :: B,DATE(2008,3,3),Database :: C)
Yvan KOENIG (from FRANCE lundi 17 novembre 2008 17:16:46) -
Using an expression in SSRS to display rolling 12 month and year to date volumes
I need some help in writing an expression in SSRS. I have a table that contains date columns and rows that contain different types of data groups. (e.g. total number of items received during the month, total dollars for the month, etc.) I want to add two
new columns to the end of the report that will display a rolling twelve month total for each of the different rows of data. Plus a column that would show year to date totals for the same rows.
I was thinking I could accomplish this by adding expressions for each row in the new 'rolling twelve month' and 'YTD' columns in my report however, I'm not sure how to structure the expressions to achieve this.
Here is an example of how my report currently looks. (I added a pipe delimeter in case the formatting changes once this is submitted.)
Jan-2014 | Feb-2014 | Mar-2014 | Apr-2014 | Rolling 12 mth | YTD
Items received 100 | 35 | 45 | 12 | 192 | 192
Dollars $50.00 | $25.00 | $120.00 | $15.00 | $210.00 | $210.00
Any guidance you can provide would be appreciated.
Thank youThis example shows how to get what you need. It'll take modifying your query to add two cased columns onto the end.
DECLARE @forumTable TABLE (periodYear INT, periodMonth INT, periodMonthName VARCHAR(12), periodDollars MONEY, periodItems INT)
DECLARE @i INT = 0
SET NOCOUNT ON
WHILE @i < 24
BEGIN
INSERT INTO @forumTable (periodYear, periodMonth, periodMonthName, periodDollars, periodItems)
VALUES (YEAR(DATEADD(MONTH,-@i,GETDATE())), Month(DATEADD(MONTH,-@i,GETDATE())), DATENAME(MONTH,DATEADD(MONTH,-@i,GETDATE())), 1000-@i, 100-@i)
SET @i = @i+1
END
SET NOCOUNT OFF
SELECT *,
CASE WHEN CONVERT(VARCHAR,periodYear) + '-' + CONVERT(VARCHAR,periodMonth) + '-01' > DATEADD(MONTH,-12,GETDATE()) THEN periodItems ELSE 0 END AS ytdItems,
CASE WHEN CONVERT(VARCHAR,periodYear) + '-' + CONVERT(VARCHAR,periodMonth) + '-01' > DATEADD(MONTH,-12,GETDATE()) THEN periodDollars ELSE 0 END AS ytdDollars
FROM @forumTable -
Calculation of ''Total to Date'' like ''Year to date''
Hello together,
How would you calculate a Total to Date in Oracle BI.
It should sum all values like Year to date up to a certain period inclusive all previous years.
Example:
Year Value
2008 10
2009 20
2010 40
If I select 2009 it shoul display 30. without the previous and the following row.
Regards,
Stefan
Content Level Fiscal Period TOTAL (Do I have to calculate on a yearly level all the past years, - ago - 1, ago -2, ago - 3, ago - 4 up to - 20?)
minus Year Value
plus YTD
Month and Total have to bes diplayed in on line.
works for the current year but not when you back to last year.
Edited by: stefanhess on Jun 14, 2010 1:54 PMan odd solution.
In the physical layer you can duplicate the fact table and can join the time dim and duplicated fact with the complex join using the year column with the condition as
time_dimension.year_column >= fact_table.year_column
in your report when you bring the year and this measure you will get what you want.
Edited by: kart on Jun 14, 2010 6:46 PM -
DAX - Year to Date Calculation
Hi All,
We have a requirement of calculating the Year to Date Calculation in DAX for No. of Sales. Below is the table that we are using:
Year
Quarter
Date
No. of Sales
If we browse the tabular model with Year/Quarter then formula should calculate the value at quarter levels.
Formula Definition for Q1 = (Total of “No. of Sales” in current Year upto Q1 / Total of “No. of Sales” in previous Year upto Q1) -1
Formula Definition for Q2 = (Total of “No. of Sales” in current Year upto Q2 / Total of “No. of Sales” in
previous Year upto Q2) -1
Formula Definition for Q3 = (Total of “No. of Sales” in current Year upto Q3 / Total of “No. of Sales” in
previous Year upto Q3) -1
Formula Definition for Q4 = (Total of “No. of Sales” in current Year upto Q4 / Total of “No. of Sales” in
previous Year upto Q4) -1
Can anybody help us in building this formula in DAX which should be able to browse with any columns of the table.
Thanks,
Vishal JharwadeHi Vishal,
According to your description, we are still not clear about your requirement. Do you want to calculate the "current YTD/previous YTD -1"? Or you want to calculate the Total Year to Quarter for each quarter?
If you want to calculate the first one, please use the formula below:
=[Sales](DATESYTD(DimDate[Datekey])) - [Sales](DATEADD(DATESYTD(DimDate[Datekey]),-1,YEAR))
If you want to calculate the second one, you can use TotalYTD() function to calculate the Year to Quarter value:
=TOTALYTD(SUM(InternetSales_USD[SalesAmount_USD]),DateTime[DateKey], ALL(‘DateTime’), “3/31”)
However, since we have to specify a literal string with a date that defines the year-end date, it can't make it dynamically to show the Year to Quarter for the current quarter. So you still can't use only one formula to deal with all quarters.
Reference:
First steps in DAX: Year-To-Date
Time Intelligence Functions in DAX
Best Regards,
Simon Hou
TechNet Community Support -
Are Cube organized materialized view with Year to Date calculated measure eligible for Query Rewrite
Hi,
Will appreciate if someone can help me with a question regarding Cube organized MV (OLAP).
Does cube organized materialized view with calculated measures based on time series Year to date, inception to date eg.
SUM(FCT_POSITION.BASE_REALIZED_PNL) OVER (HIERARCHY DIM_CALENDAR.CALENDAR BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN ANCESTOR AT DIMENSION LEVEL DIM_CALENDAR."YEAR")
are eligible for query rewrites or these are considered advanced for query rewrite purposes.
I was hoping to find an example with YTD window function on physical fact dim tables with optimizer rewriting it to Cube Org. MV but not much success.
Thanks in advanceI dont think this is possible.
(My own reasoning)
Part of the reason query rewrite works for base measures only (not calc measures in olap like ytd would be) is due to the fact that the data is staged in olap but its lineage is understandable via the olap cube mappings. That dependency/source identification is lost when we build calculated measures in olap and i think its almost impossible for optimizer to understand the finer points relating to an olap calculation defined via olap calculation (olap dml or olap expression) and also match it with the equivalent calculation using relational sql expression. The difficulty may be because both the olap ytd as well as relational ytd defined via sum() over (partition by ... order by ...) have many non-standard variations of the same calculation/definition. E.g: You can choose to use or choose not to use the option relating to IGNORE NULLs within the sql analytic function. OLAP defn may use NASKIP or NASKIP2.
I tried to search for query rewrite solutions for Inventory stock based calculations (aggregation along time=last value along time) and see if olap cube with cube aggregation option set to "Last non-na hierarchical value" works as an alternative to relational calculation. My experience has been that its not possible. You can do it relationally or you can do it via olap but your application needs to be aware of each and make the appropriate backend sql/call. In such cases, you cannot make olap (aw/cubes/dimensions) appear magically behind the scenes to fulfill the query execution while appearing to work relationally.
HTH
Shankar -
Upon transferring to the cloud, all my previous mail says it entered my box on the same date, except for today and yesterday. Everything else says it came in on the same date on which I had to replace the hard drive 3 years ago. Totally stumped. It didn't do this on my mac...only when I moved. I have bad feelings about being to fix this...Any suggestions?
Get the new keyboard at eBay and replace by yourself may be cheaper way, though you're required higher skill and well know about MacBook Air.
http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0 .Xmacbook+air+2011+keyboard&_nkw=macbook+air+2011+keyboard&_sacat=0
https://www.youtube.com/watch?v=gLbasVD69xo -
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. -
Need total consumption quantity year to date for item in inventory
Hi All,
I have a requirement as below.
I need to find the total consumption quantity for a item year to date in inventory i.e i need to find out total issued quantity from year to date for a item.
so i need following details.
Consumption 1st year
Consumption 2nd year
Consumption 3rd year
we are following fiscal year JAN-DEC.
I am looking for a query to find out the above details, please help me out
ThanksHi Prashant,
I will try this out. If I remember correctly this did not work especially since we are using the same base condition across the board. I may have to try copying this standard condition and re-assigning it accordingly.
Thanks for the suggestion
Anirudh -
Month to Date and Year to date calculation
Hello Experts,
It would be great If you could provide the formula to implement in BO universe or in the Reporting level for the below requirement.
MTD, LastMonth, Year to Date, Last to LastMonth and examples are below.
Last Week:
Eg: Monday through Sunday
Description: Based on Todayu2019s date, select the Monday of the previous week for the start date and Sunday will be the end date.
Example:
If Today is May 22, 2009
The result would be, Monday = May 11, 2009, Sunday = May 17, 2009
MTD:
If Today is May 22, 2009
I need a result MTD = May 1, 2009 u2013 May 21, 2009
LastMonth:
If Today is May 22, 2009
I need a result LastMaont = April 1, 2009 u2013 April 30, 2009
Last to LastMonth:
If Today is May 22, 2009
I need a result LastMaont = March 1, 2009 u2013 March 31, 2009
Thank you.Nisniki,
Here are the methods using WebI:
MTD:
Create a local variable "MTD Start"
=RelativeDate(LastDayOfMonth(RelativeDate(CurrentDate();-30));1)
Create a local variable "MTD End"
=currentdate()
LastMonth
=LastDayOfMonth(RelativeDate(CurrentDate();-30))
Year to Date
create a local variable "YTD Begin"
=ToDate("01/01/"+FormatNumber(Year(CurrentDate());"####");"mm/dd/yyyy")
(reuse "MTD End" or build a "YTD End" variable same as "MTD End")
Last to LastMonth
(similiar to MTD, but using "60" versus "30" to move back two months versus moving back 1 month.
To perform this stuff in the universe requires an understanding of the SQL syntax for the paricular vendor your are working with. ANSI SQL agrees to represent and compute dates uniformly, however, the functions to make it happen varies by the vendor.
Thanks,
John -
Calculating HTD(Half Year to date) in Essbase
Hi All,
Is there any way in essbase where in you can calculate HTD(half year to date) Values.
I know in essbase we have Dynamic time series where in you can calculate YTD,HTD(History to date),MTD,QTD,...etc.
can you guys have any thoughts on as how HTD(half year to date) is achievable in essbase.
thanks in advance.Can you modify your time dimension to look like
Time
-1st Half
---Qtr1
------Jan
------Feb
------Mar
---Qtr2
------Apr
------May
------Jun
-2nd Half
---Qtr3
------Jul
------Aug
------Sep
---Qtr4
------Oct
------Nov
------Dec
If so, you could enable a dts member and set the alias to be hf-t-d
if you can't add those members, condider adding a dynamic calc member with a formula
psudo logic would be
If it is a descendant of Q1 or Q2 then sum Jan to the current month else if it is a descendant of q3 or 4 sum jul to the current month -
Regarding year to date Calculations
Hello,
I Have a requirement to calculate the Year to date. When i input the value 009/2008 the exit should calculate the value from 001/2008 - 009/2008. the values should cumulate.
For eg: For the period: 002/2008 value is 10
003/2008 value is 20.
cumulative value should be 30.
Thanx in advanceHi,
there are content varables that you can use in a query for this purpose. They are deliverd for the InfoObjects 0CALMONTH (0CYTLM: 'Cumulated to last month' or 0CYTCM 'Cumulated to current month' for example) and 0FISCPER. They select the complete range from periode 01 to your actuel month and therfore give you the cumulated value.
Hope that helps
Regards
Christoph Vortkamp -
Return current period based off of current fiscal year and date
Good Afternoon,
Is there a way in the webi that I can create a dimension that always reflects the current Fiscal Month based of Fiscal year and date? I have a report that I am trying to show sales for a customer based off the current fiscal month. I would like this report when refreshed to be based off this fiscal month dimension instead of showing each fiscal month or changing it manually. What is the best way to do this?
I have attached an image that shows current numbers by period (month) and then the YTD Totals. I would like to have my 'Period' column always reflect the current period and the Total column to reflect that months totals based off the period column. So for this period (3), instead of seeing 3 lines for each month I would just see the '3' and the total as $541,310.46, monthly as 412,502.09 and my YTD as 1,080,091.06.
Any help is always appreciated!
Thank you,
TiffanyHi,
Create a variable
FlagVar=If([Period]=Max([Period]) In Report;"Show";"Hide")
And apply block filter of FlagVar=Show
Are these coming TotalSales MonthlyGoal YTDSales directly from universe? If they are calculated at report level then you might want to use NoFilter. like =NoFilter([YTDSales])
Maybe you are looking for
-
Authorization based on personnel subarea
Hi All I have to set up an authorization for my HR users restricted upon their location of work. I have set up personnel subarea for the same. However, am not able to find the personnel subarea object in the profile generator screen for the role. For
-
I have lost all the in-built location apps - wifi etc
-
Joining InfoObject attributes and descriptions in one Object
Hi all! I have an InfoObject with attributes and a short and a long description text (language depending). I need to distribute this InfoObject via Open Hub in one table. So i need to join the attribute table with the text table. Structure of Open Hu
-
ITunes match creates duplicates of all songs a computer upgrade
So I had a mac mini and over the summer I deleted all my music on my computer and redownloaded using itunes match to get the higher quality for a number of my older rips. Fast forward to last month when I upgraded to a macbook air. Instead of downlo
-
Problem with calendar - lenovo A5000
Yesterday my calendar was marking in 23 and writting 24 in redToday every time I open it goes to 1 Jan 1970