Tableau calculation I am trying to create the purchase rate calculated field which is the sum of purchases/ Sum of submissions. But my dataset is set up in such a way that the purchases are unique at a month, org,channel,flag level .But the submissions are unique only at a month, org, channel level .So I should not double count submissions in the denominator...Can you please help me here.. I have attached the data with the calculation..
sum(purchases)/sum(submissions)..But I should not double count submissions
Related
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.
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:
I have a list of customers and there price of the product. I want to change the price anytime might be once in a month or once in three months or once within 15 days. I keep changing according to the market demand. my need is that my old price calculation should not affect with new price in google sheet. kindly help me with best formula or suitable link where it fulfill my need
Your first intuition should be to find how to lookup for the price for a particular customer against the table of prices you've set up for each product: so your first choice is to use the function VLOOKUP to find (vertically) the the customer in your table, then to use HLOOKUP to find (horizontally) the product, both together will give you the matching price. But now you have another problem: being able to change the price from time to time. You could use a simple approach (which avoids dates manipulations), by adding another criteria in your VLOOKUP search, which can be something like PRICE ID:
and keep it very simple: A,B,C,D...etcc for any new price. Meaning before the date, you will choose which price should be considered for the row that you're entering data for.
So to get the RATE:
= ArrayFormula(IF(LEN(K5:K) * LEN(M5:M), VLOOKUP(L3 & K5:K, {
$B$4:$B & $A$4:$A,
$C$4:$I
}, match(M5:M, $B$4:$I$4, 0), 0), ))
To get the AMT:
=ARRAYFORMULA(IF(LEN(N5:N),N5:N*O5:O,))
Spreadsheet Demo: HERE
I have a google sheet which is like a register where I keep all purchases for a business. I have purchases made with different types of methods. I would like to specifically be able to track the amount of cash on hand at all times. I have a sheet I have created that already calculates other stuff by formulas. Here is a Public link to a demo version:
https://docs.google.com/spreadsheets/d/1mArgTCpxYajmk2bOkE3aIaDTevajYxvsQW5P2cJbb8k/edit?usp=sharing
What I need exactly is a formula that will subtract cash purchases from the on hand balance calculated by adding the Replenishment column then subtracting from the Costs field but only if its a cash purchased item.
=IF(D4:D="Cash"),=Sum(L4:L) - Sum(F4:F)
Cash on hand to reflect actual amount and deduct cost amount of cash purchases.
Why anyone would want the result escapes me but, where the row contains Cash in ColumnD:
=sumif(D:D,"Cash",L:L)-sumif(D:D,"Cash",F:F)
will add the ColumnL values and subtract the ColumnF ones.
=sum(L:L)-sumif(D:D,"Cash",F:F)
would seem to make a little more sense.
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.