Income Statement Subtotals In Tableau Worksheet - tableau-desktop

Sample Data
First, I am trying to create your basic multi-level income statement.
Gross Sales
Discounts
Net Sales
COGS
Gross Profit
and so on. I have tried turning on subtotals for all columns. I have searched for an answer for days now, but the one example on the Tableau forum has SUM(Amount) only. It has various different groups; covering the income statement categories. This example has a grouping of groups. I can mimic this, but it gets me no closer to, for example, calculating gross profit (net sales minus cost of sales). For presentation purposes, all of the values need to be positive, except of course if there is negative gross profit; e.g., a loss. Therefore, for some subtotals I am subtracting one subtotal from another. I am relatively new to Tableau and I am at a dead end since I don't know where to turn. My data sheet is simply an Excel workbook with transaction date, account, product, product category, and amount.

Related

Complex Google Sheets Puzzle - Help appreciated - Link to sheet included

I have a finance sheet that tracks the following in different columns:
(A) Amount Already Built Into Budget for the Year [Purple]
(B) Amount Spent Year-to-Date [Red]
(C,E,G,I) Q1-Q4 Reimbursement amounts [Green]
(D,F,H,J) Q1-Q4 Hidden columns to be used to help create this function and to tick on and off based on reimbursement amount input [Gold]
(K) Reimbursement Remaining [Blue]
The amount already built into the budget needs to be divided by 4 and to show up on each quarter as reimbursed. That amount will be entered into each quarter by default with a code that divides Column A by 4. The user will replace that value each quarter by adding the column K value to the value for that quarter.
Each quarter, the user should be able to add the value in column K to the appropriate quarter and end up with zero balance in column K.
The Amount Spent Column will update monthly and include:
Expenses built into the budget to-date
Additional expenses to-date
The goal of this sheet is to allow someone to input how much was actually reimbursed in the Q1-Q4 Reimbursement amounts [Green] and to provide a tool for that person to know how much needs to be reimbursed at any given time in the Reimbursement Remaining [Blue] column.
Column K needs to still be able to function if all expenses appear in the actuals Q4--meaning, Column K will need to be zero for Q1-Q3 and only show a balance if the sum of the actuals recorded exceeds what was built into the budget.
Wow that was hard to write out.
What is a formula that could go in Column K to make this work?
I hope this makes sense to someone!
-Alfred
try:
=if(C2+E2+G2+I2=A2+B2,0,
if(AND(D2+F2+H2+J2=0,D2=0),B2-C2,
if(AND(D2+F2+H2+J2=1,D2=1),B2-C2,
if(AND(D2+F2+H2+J2=1,F2=1),B2-C2-E2,
if(AND(D2+F2+H2+J2=1,H2=1),B2-C2-E2-G2,
if(AND(D2+F2+H2+J2=1,J2=1),B2-C2-E2-G2-I2, 0)
)))))

Calculate a percentage for subtotals in a Pivot Table - Google Sheets

I have a pivot table that is pulling in quarterly sales data and splitting it up by lead source. I want to calculate the percentage of leads brought in by each person as compared to the subtotal of jobs per quarter.
The problem I am running into is I cannot figure out how to get the subtotal as a number in my calculated field. The equation is simple- total leads per lead source divided by total number of leads. But because I have the pivot table split up by lead source, I cannot get the subtotal to calculate.
In my screenshot, you will see the "% of Total Jobs" column looking correct in the 2021-Q4 category. This is because I just did the Calculated field as "=counta(Project)/16." This is what I want it to look like dynamically for each quarter, with the "16" being replaced with whatever the subtotal of that quarter is. For instance, for Q3, that number should be 14.
The solution might be right under my nose and I'm not thinking of it.
Google Sheets screenshot of pivot table
Thank you!

how to pivot balance amount in google sheet

I am using this formula in I5 =G5-SUMIF($A$5:A5,A5,$K$5:K5) to calculate the outstanding amount which is getting 0 once all the fee is paid, then I am pivoting the data to compare the course Fee vs Outstanding amount as shown in the below pivot screen shot:
As per the calculation I want to compare the fee amount received vs remaining balance in the pivot of a respective reg no. If the final balance is 0 it should show in the pivot instead of adding the course outstanding entries.
Please help me out.
Sample worksheet : https://docs.google.com/spreadsheets/d/1roEXEuBBwHU8lKV_QruY6hVjYOOkpwAwAI5x8yuYfZ8/edit#gid=339420405
Solution:
Since the balance goes down every time a payment is made every row, you can use MIN of Course Outstanding Amount Rs on the PivotTable values to show the final balance:

Average instead of Sum in Grand Total of Pivot Table in Google Sheets

In Google Sheets, is there any way that the "Grand Total" of a column in a Pivot Table is something different than the values of the column represents? (for instance, in a sum column, show the average).
An example would be in a sheet with daily sales of several products. You want in the column for each product to show the yearly sales (sum column), but the grand total to show the average of the values in the column.
This is very easy to do in Excel, since you can configure the Grand Total to be other function. I have not been able to find the same functionality in Google Sheets.
Edit: Original question was badly formulated.
Though it reads Grand Total, the presented result depends on the choices you make on Summarise by as clearly seen in the image.
In our example for Days the Grand Total is the average of all days.
For Points the Grand Total is the minimum of all points

Data warehouse reporting questions

I've just begun diving into data warehousing and I have one question that I just can't seem to figure out.
I have a business which has ten stores, each with a certain employees. In my data warehouse I have a dimension representing the store. The employee dimension is a SCD, with a column for start/end, and the store at which the employee is working.
My fact table is based on suggestions the employees give (anonymously) to the store managers. This table contains the suggestion type (cleanliness, salary issue, etc), the date it was submitted (foreign keyed to a Time dimension table), and the store at which it was submitted.
What I want to do is create a report showing the ratio of the number of suggestions to the number of employees in a given year. Because the number of employees changes periodically I just can't do a simple query for the total number of employees.
Unfortunately I've searched the web quite a bit trying to find a solution but the majority of the examples are retail based sales, which is different from what I'm trying to do.
Any help would be appreciated. I do have the AdventureWorksDW installed on my machine so I can use that as a point of reference if anyone offers a suggestion using that.
Thanks in advance!
The slowly changing dimension should have a natural key that identifies the source of the row (otherwise how would it know what to compare to detect changes). This should be constant amongst all iterations of the dimension. You can get a count of employees by computing a distinct count of the natural key.
Edit: If your transaction table (suggestion) has a date on it, a distinct count of employees grouped by a computed function of the suggestion date (e.g. datepart (yy, s.SuggestionDate)) and the business unit should do it. You don't need to worry about the date on the employee dimension as the applicable row should join directly to the transaction table.
Add another fact table for number of Employees in each store for each month -- you could use max number for the month. Then average months for the year, use this as "number of employees in a year".
Load your new fact table at the end of each month. The new table would look like:
fact table: EmployeeCount
KeyEmployeeCount int -- surrogate key
KeyDate int -- FK to date dimension, point to last day of a month
KeyStore int -- FK to store dimension
NumberOfEmployes int -- (max) number of employees for the month in a given store
If you need a finer resolution, use "per week" or even "per day". The main idea is to average the NumberOfEmployes measure for a given store over the year.

Resources