My problem is that I need to calculate a running total that works like a YTD.
The "year" in question is not a calendar year, it is an academic period.
TOTALYTD(..."28-02") nearly does the trick, however on leap years the 29th of Feb bleeds in to the next year's window.
I've tried CALCULATE(MyMeasure, DATESBETWEEN(...,...)) and this doesn't seem to work or I am just using the functions incorrectly.
To summerise, I need an expression that works exactly like TOTALYTD() but does not have the leap yer problem.
Thanks!
Unfortunately, I also experienced the same problem.
I created a dates table with a check to see if the year is a leap year.
Then I created this Dax Formula: Year End = IF(MAX( Dates[LeapYear] )=0,"02/28","02/29")
This worked perfectly, but if I add this to the TOTALYTD built-in formula like this Sales YTD = TOTALYTD( [Sales], Dates[Date], ALL( Dates[Date] ), [Year End]), it does not allow it - which is stupid - hopefully, they will allow this in the future.
I then found this answer, which answers your question but also doesn't because Power BI does not cater for it yet.
"You will need to write custom YTD measures instead" as per OwenAuger
Related
Picture
I would like to create a query that takes the Week Ending Date (typically a Friday) and calculate the number of Working Days in each Week.
I have a choice of either every day possible (All Days), or just the Working Days. For example, some weeks would be shorter than other due to designated Holidays. I coded each day as either 1 = Working Day, 2 = Sat or Sunday and 3 = Holiday.
Which would be the easier solution? Go exclusively the Working Days off the Working Days Qry against the Week Ending Table? Or use the All Days Qry against the Week Ending Table? Tried looking up as much as possible on this very helpful site, but couldn't quite find a match to this. Thanks
Tried looking up a lot here, but couldn't find an exact match to my problem. Mainly a Design View guy here, with limited SQL experience.
Which would be the easier solution?
I'm not sure, but a simpler method could be to record the holidays separately, and then calculate the difference in workdays between any two dates.
For this, you can use my function DateDiffWorkdays.
For extended date handling and calculation, see my library at GitHub: VBA.Date.
Long time Stackoverflow user, but never actually asked questions. I'm currently stumped on a report request.
What I need to do with Report Builder is displaying data on pages grouped by three years, but here's the catch: I need it to be revolving.
I put together a query, but it's static:
SELECT distinct *, (dense_rank() over (order by [Year]) - 1) / 3 + 1 as [group]
FROM dwmy
It works fine for grouping years when I don't also need to still display past years. To give you an idea of what I'm trying to accomplish.
So, in the current year, it would look like:
In 2022:
In 2023:
As you can see, the current year still stays within the first group, but as a new year starts, it slowly works its way off the first page. The old groupings would still be on older pages, so users could still see the old groupings of 2019, 2020, 2021 or 2020, 2021, 2022.
I am a newbie at Tableau (thought I have spent years working in R and Python), seems to be different in the way it handles things or I'm just not thinking the right way.
I have a data sources with training data (employees training and the status). The point is to build a dashboard that shows the % of training that is overdue. I have all of the logic for it, but I am stuck on something.
I have a calculated field to show me the total training due, then when I put that in a table, with a filter by year and a breakdown by month, I get the totals by month - good deal.
Now, I need to perform an year calculation (not the months, but the year based on a few different things), so my first step is I need to get the "Total Training Due" for December 2018. I have a dimension called "Due Month" which is a numeric (1,2,3,4, etc.) representing the month. So, based on what I have observed, I just need to do a little IF statement like so (keep in mind this is only for 2018 data right now):
IF [Due Month] = MAX[Due Month] THEN COUNT[Employee ID] END
I know this isn't the exact context, but it's sort of what I am looking for. So, for 2018, it would mean that, for all rows that are of month 12, I want to count those up (each row is a unique training requirement) and I want the total for the latest month in the data set. My overall goal is to create the calculation I need in a new sheet with a single calculated field (See the image below of the Excel spreadsheet and the J10 calculation). Then I can use a dashboard to combine everything. I thought about a total row at the bottom, but there isn't enough ways to change the totals to customize it to what I need. I figured I dashboard was the way to go and replicate each part it its own sheet.
I have seen so many suggestion for things like this, but not exactly this. I have tried many, but nothing that works. Here is the spreadsheet I am trying to replicate:
As you can see that calculation in J10 is kind of weird, no biggie for Excel, but I am struggling to replicate this in Tableau. Here is what I have in my Tableau so far, I'm 90% of the way there, I just need that last calculation. I have replicated the main table, and figure I'll do this J10 calc on a new sheet and just put them together on a Dahsboard. The only thing is, I want this to work when new data comes in, so I don't want to hard code any month numbers in there, I want it to be dynamic. Here is what I have on the tableau so far:
Thanks in advance!!
To get the value in Tableau that you have in F11 it's:
{FIXED [Due Year] : sum([Incomplete Overdue])}
You should be able to create that as another calculated field and then reference it, or include it directly in the Total Past Due Rate calculation.
This is an LOD calculation, the [Due Year] means that you only want the result dimensioned by the [Due Year] dimension, so you will get a different result for each year in the data source.
Thanks for this - after posting this, I was able to come up with this:
(TOTAL([Incomplete Overdue]) + SUM(IF ([Past Due]<0 AND INT([Due Month]) = {MAX(INT([Due Month]))}) THEN 1 ELSE 0 END)) / COUNT(IF INT([Due Month]) = {MAX(INT([Due Month]))} THEN [Employee ID] END)
Which works for the basic result I was looking for.
i just installed odoo 11 CE and managed to get the accounting features by activating in the user settings. However the most important functions to create fiscal periods and to close a fiscal year properly seems to be completely missing.
If this is the case and this is only available in the enterprise version the CE version becomes pretty much useless for accounting.
Thanks for any hint
Peter
Peter,
In odoo 11 (and I think since odoo 9) there are not Fiscal Periods anymore. The way to act is to create Date Ranges, that are multi propose ranges to use anywhere.
Conceptually there is not a closing of the fiscal year, but you can filter all your data by Date Ranges and make all your reporting based on this new model.
This seems to be a more flexible and powerful tool, but here is the bad news. One basic thing I think Odoo has missed out is the functionality of close a period or, in other words, to prevent of creating journal entries to the users when they are in a period. You have to use locking dates. This functionality is half implemented but it is very blocking. After the locking date, you cannot register payments because they are creating journal entries after the blocking date. I have searched a lot and I have found this PR in the OCA related with a set of functionalities to solve all this scenario.
Hope it helps to give you a scope of the functionality and limitations.
Cheers,
Pere
You can specify the fiscal year end in Odoo by entering the Fiscal year last day, and specifying locking status as below:
After this, there is no need to make a 'physical closure' for the fiscal year.
In Odoo there is no need to do a specific year end closing entry in
order to close out income statement accounts. The reports are created
in real-time, meaning that the Income statement corresponds directly
with the year-end date you specify in Odoo.
Reference:
https://www.odoo.com/documentation/user/11.0/accounting/others/adviser/fiscalyear.html
From Odoo 11, closing of fiscal years happen automatically at designated year end i.e balances of P&L accounts are zeroed out and the net is carried forward in the Balance sheet. All you need to do is to decide how to allocate the current year earning.
I want to summarize figures for the previous year based on multiple possible selections in Year, Month and Day to provide a previous year comparison on my dashboard: see screenshot.
I have found plenty of working examples for previous year summaries applied to a fixed dimension but none to assist with providing a summary for a range of possible selections.
I have tried numerous set analysis expressions so far, and I have tried adding a variable which calculates 1 year prior and including it in expressions, but the difficulty has been where to include the '1' or select from all possible records in the expression.
Most recent attempt as below calculates but returns 0.
sum( {$<Discharge= {$(#vPrevYr)}>}daycase)
Can anyone assist?
Found the solution:
Changed the variable to
vYearMinus1= Discharge_Year-1
Used in expression
sum({$}daycase)
All hunky dory, selections all (multiple or other) produce previous years figures: Yay!
Table from which figure will be extracted includes the year dimension: see attached screenshots Table including dimensions and finished result Finished result