How to create the grant total for AGG variable the table tableau dashboard - tableau-api

NUMBER OF OPPORTUNITY= count([opportunity id])
how to sum up the NO.of opportunity for each category
for example:
health grant total:8
commercial lines grant total: 9
Thanks a lot

To display subtotals, choose Show all subtotals from the Analysis menu under Totals.
To calculate subtotals, you could use either a fixed or exclude LOD calculation. LOD calcs are described in the help and worth the time to understand.
Also, be sure you understand the difference between Count and Count Distinct. All count([xxx]) does is return the number of data rows that have a non-null value for the [xxx] field. If [xxx] is never null, that is the same as SUM([Number of Records])

I am trying to explain with example as:
Your data is as per above example and you want totals of all region according to category wise.
Here are the steps to execute.
1.Go to analysis > totals > Total using subtotals and you will get results as
2.To get exact sum follow the steps as per below :
Hope this will help.

Related

Tableau Target Vs. Actual - Can not get totals to show correctly

I am having trouble showing the correct totals in my tableau worksheet.
I have supervisors that are part of specific zones that need to complete a certain number of tests in different categories. For example, supervisor 15716 must complete 8 tests in category 1. I need to show the target, which is a number stored in the database and show the actual number of tests in that category that have been completed within a date range. I have it working, but Im not sure if I did it correctly because I can not show any totals.
System target - number stored in database
CountOfSheetID - calculated field
Percent Compliant - calculated field
Try this approach -
First define a calculated field called [Within Date Range?] as
[Date] >= [MyStartDate] AND [Date] <= [LastSelectedDayOfMonth]
and put that new field on the filter shelf, only including data where [Within Date Range?] is True. (You could also just filter the [Date] field if that is flexible enough for you)
The you don't need the CountofSheetId calculated field at all. If you want to know how many records have a non-null value for [SheetID] within your date range, you can simply drop [SheetID] on a shelf and choose to treat it as Measure with the aggregation function COUNT()
Then just build your visualization to show the counts you want (not percentages, the actual counts)
Finally, you can convert counts into Percentages by clicking on the pills for your Measures and choosing Percentage under Quick Table Calcs. You'll want to experiment with the "Compute Using" setting to tell Tableau how to compute your percentages -- i.e. define percentage of "what".
Percentages are implemented as table calcs in Tableau. Read the help to understand table calcs, especially the description of partitioning and addressing.

Using COUNT in Tableau to count observations by group

Thanks in advance for any advice you can offer! I'm building a Tableau dashboard to explore housing affordability and school quality in different neighborhoods in my area. A user will select their occupation and see a graph of neighborhoods plotted based on school quality and housing affordability. To explore housing affordability, I'm using county level assessor data with the valuation of every property matched to neighborhoods.
The goal is to display the percentage of homes in an area that are affordable given the median occupational wages for the job a user selected. Right now, I'm trying to use a calculated field with COUNT([Parcels]<[Occupation])/COUNT([Parcels]), but I need to find a way to count the number of properties in each specific neighborhood below the cut off value.
Does anyone know of a way to count elements of a particular group in this way in Tableau?
I'm on a Mac, using Tableau Desktop, and doing the back end analysis work in R. Thank you!
You seem to misunderstand what the function COUNT() does. You are certainly not alone. Count() behaves in Tableau almost identically to how it does with SQL.
Count([some field]) returns the number of data rows where the value for [some field] is not null. It does not not return the number of rows where [some field] evaluates to true, or a positive number, or anything else.
If [some field] always has a non-null value, then Count([some field]) is the same as SUM([Number of Records]). If [some field] is always null, then Count([some field]) is zero. Count() is not like Excel's CountIf function.
If you want to count data rows that meet a condition, you could try COUNT(if [condition] then 1 end) Since the missing ELSE case defaults to null values, that expression will count rows where [condition] is true.
So one way to get the percentage of affordable homes is count(if [affordable] then 1 end) / count(1) assumes each Data row represents a home. Then format your field to display as a percentage. Another option is to learn to use quick table calcs
If you want to display the number of rows in a given visualized table you could also use SIZE()
Source, official docs:
https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm#size

Add a Calculated Row For Custom Subtotaling

I'm trying to perform custom subtotaling on sales data to give a total for US and Non-US sales offices. My worksheet looks like the table labeled "current" and I am trying to make it look like the table labeled "desired result"
When I tried to group the sales centers as US and Non US the pill (dimension) was greyed out. After googling through a bunch of threads I found that grouping was not supported for secondary data sources. Is there anyway to do a manual calculation in the table calculations to add a row or do custom subtotaling?
Add a column for the country (assuming that you have the country in your data)
[see my example I had states and zip codes]
Then go to analysis > totals > check on show grand total and on add all subtotals
Visit Calculations totals - Grand total turn on for more information.

Crystal Reports XI Crosstab summary

I have a crosstab report that provides a summarized distinct count of students and a sum of all credits per term. I need a summary that divides the summarized credits by the summarized students. Is there a way to do this?
It's hard to solve this with the given information (i.e. not knowing exactly how the data is coming into the report) If the count of students is already passed into the report, this may solve your problem:
In your CrossTab Expert, create a new formula #AvgCredits, which is Credits/Students
In your CrossTab Expert, place the following fields in the "Summarized Fields" section:
Count of Students
Sum of Credits
Weighted avg of #AvgCredits with StudentsCount (you may need to add the Formula to the Summarized Fields section first, then click "Change Summary" to change it to a weighted average.)

Crystal Report: Get Minimum Date

I have this concern using Crystal Report which I am not really familiar with. Here's my scenario:
I have an existing report to update, I need to add a column (ETA) which has a datetime value. It may return more than one rows per Item No, I need to get the minimum date only per Item No from the result rows.
I already tried some solution mentioned here http://scn.sap.com/thread/1952829 but found no luck.
I used a suppression formula for the Details section of the report, but haven't succeeded yet.
IF {TableName.DateField} = Minimum({TableName.DateField}) THEN FALSE ELSE TRUE
Any possible things you can suggest me to try? Thanks in advance for this :)
good to get this value from sqlserver side. you just create a function which return a single data (minimum date).
If you wish in crystal report side, it is something you make loop of hundred for a single row display. You can use running total field for this.
Select the field , select summary type and put into the detail section.
or you can create a formula with group name option like
Minimum({TableName.DateField})
http://scn.sap.com/thread/1952829
http://businessintelligence.ittoolbox.com/groups/technical-functional/businessobjects-crystal-l/unable-to-filter-based-on-the-first-date-in-list-of-dates-4912881
please check
Running total field gives options for Min, Max, etc. but not Sum
http://flylib.com/books/en/4.229.1.28/1/