Can I create a calculated field like % of total? - excel

I know I can create the % of Total by selecting the option from the Value Field Settings > Show Values As section, but I'd really like to show my percentage as an index (% of col total * 100)
Can I get formula with the calculated fields? I can't seem to get any kinds of sum() or total() to work in the create calculated field pane
EDIT: ADDED IMAGE FOR CONTEXT
I created an example of what I'm trying to achieve: I just want to display the %of Col Total, but as a whole number; it's a straightforward calculation, but I can't seem to recreate it as a pivot calc. I'm also open to reformatting that output, but I haven't been successful doing that either

Related

How to get this chart to show numbers instead of squares

I transferred the file from Excel into my Tableau sheet and created two new variables. One is a parameter based on the Sales variable. I set the value at 10,000. Then I created a calculated variable called "Sales Spotlight" that states:
IF(SUM([Sales])) >= [Sales Parameter] THEN "Good" ELSE "Bad" END
This is what the screen looks like:
The result is correct except the values in the table are string values instead of number values. I can't figure out how to change the data in the table to numbers.
To confirm, you want to display Sales as a number in your chart?
In theory, you should be able to do this by changing Mark type from "Automatic" to "Number" (or "Text"?).
Failing that, try dragging Sales from the far-left side on to your viz under Rows, and again explicitly set the Mark type.
Proviso: it's been a while since I've used Tableau and I don't have it available so cannot verify the answer above but it should work.

how to get different cell groups each add up to a certain number

I have an excel file that has one column which contains numbers that represent file sizes, each of those numbers is a floating point number with a max decimal places of two (Ex: 23.04). the total cells count is (277 cells).i want to automatically group cells that add up to (1000) or as close as possible to that number (1000). the sum of all the cells is (5739.49) so, there should be (4) groups of cells, each adds up to (1000) and the last one (5th group) doesn't matter how much it adds up to. now :
I know that this can be solved using "THE SOLVER" in excel for each group But i'm
not sure what constraints i should use and which solving method (i.e, the simplex, GRG nonlinear or the evolutionary) methods because i'm not familiar with it
thank You in advance
As I mentioned in the comment, the standard solver in Excel has a maximum limit for decision variables of 200.
This example is limited to 200 variables - if you have the premium solver, you can expand the solution. This was done using Excel 2016.
Worksheet setup
Column A contains the size data.
Column B contains the "Group" that each member in Column A will belong to. It is initially populated using the formula =RANDBETWEEN(1,5). It was then overridden using Copy / Paste Special - Values.
Column D contains the aggregated groups, labelled 1 through 5.
Column E contains the aggregated size within each group. It is calculated with =SUMIF($B$2:$B$201,"="&D2,$A$2:$A$201)
Column F contains the target value for each group (1000 for groups 1 through 4, ignored for group 5).
Column G contains the squared error from the target value for each group. It is calculated with =(E2-F2)^2
Cell G7 will be the "Set Objective" cell and is the sum of error squared. It is calculated with =SUM(G2:G5)
Below is a screen shot of the setup worksheet, before using solver.
Solver Setup
Solver is setup with the following criteria ...
"Set Objective:" is $G$7
"To:" is "Min"
"By Changing Variable Cells:" is $B$2:$B$201
"Subject to the Constraints:" includes: $B$2:$B$201 <= 5, $B$2:$B$201 = integer, and $B$2:$B$201 >= 1
"Select a Solving Method:" is Evolutionary. Note: You could use GRG, but it will be much slower.
In "Options", on the "All Methods" tab, in the "Solving with Integer Constraints" area, make sure Ignore Integer Constraints is not checked.
Below is a screen shot of the Solver Parameters dialog:
Solution
Your optimal region may be "flat" so there are multiple possible solutions.
Below is a screen shot of a solution I generated ...

Add totals to the Tax Details Report

On the Tax Details report (TX620500), what is the best way to:
1. Add the Total Sales column to the left of the “Taxable Amt” field
2. Then add subtotals at the bottom all three columns (Total Sales, Taxable Amt, Total Tax) I have tried numerous different ways with zero success.
Here are some things I have tried:
1. To add the total sales column:
I added a text box in the details section 1 and changed the value to =Sum(ARTran.CuryTranAmt) - that didn't work. I am not looking for a count, but that is what this seems to be giving me.
- I added a text box in the details section 1 and changed the value to =[ARTran.CuryTranAmt]- that didn't work (same issue with the count)
2. To add the subtotals: I added a text box in the page footer (also tried report footer) and changed the value to the following three fields (one for each that I need totals for):
=Sum(RowTaxDetailReport.TaxRate)
=Sum(ARTran.CuryTranAmt)
=Sum(RowTaxDetailReport.ReportTaxableAmt)
The report takes forever to run with these changes. Then, numerous lines are repeated at the end. This shouldn't be too difficult, but maybe I am missing something...
I would add a Variable at the Details level let's say TaxableTotal.
Then have it's value be = $TaxableTotal + [ARTran.CuryTranAmt]
Then at the footer of the group, enter =TaxableTotal to get your total.
And repeat for the other fields you need to sum up

how to use parameter display output as a value to calculate this value in other issue?

I have made a parameterDisplay to calculate someData to get the timezone for the target and actual salestargets, then the report shows me this value example (100%).
So now I need to use this 100% to multiply it in another thing example (100% * actual target).. so how can I use this output in another calculation?
Go to the query.
Drag data item from the toolbox.
Assuming your prompt name is prmSalesTarget, then in the expression write ?prmSalesTarget? * ActualTarget.
Give meaningfull name to the data item and drag it into report

How to get total of top 10 sales in SSRS 2012

I am taking Top 10 of Sales Volume grouped by Product categories in SSRS 2012.
I need the total of these top 10 but it shows the complete total. I cant do it on dataset level as I need the complete dataset for other parts in the report. I tried the solution as given in MSDNlink but that didn't help either. Thanks in advance.
This sort of approach does actually work very well.
You haven't given any idea of what your data/metadata is like, but the concepts can be explained with a simple example. Consider the following data:
We will make a simple report based on this, grouped by the grp column:
Sort the groups by total val, from highest to lowest:
To get the running rank and the running total, we use the RunningValue function.
To get the Group Rank, use:
=RunningValue(Fields!grp.Value, CountDistinct, Nothing)
To get the running total use:
=RunningValue(Fields!val.Value, Sum, Nothing)
Finally, we need to display a total for the Top N values; in this case I'm displaying the top 2.
For the second group detail row, use the following Row Visibility expression:
=IIf(RunningValue(Fields!grp.Value, CountDistinct, Nothing) = 2, false, true)
That is, only display this row when there have been two groups, i.e. top 2. You could change the value as required.
This shows us one total row as required:
You need to apply these concepts to your data. If you're still having issues, I suggest trying to replicate my results with the above data/code to make sure you understand all the concepts involved.
Edit after comment:
For situations where there are fewer than N groups but you still want to display the last total, you need to add an extra check to the Top N row Row Visibility expression, something like:
=IIf(RunningValue(Fields!grp.Value, CountDistinct, Nothing) = 10
or (RunningValue(Fields!grp.Value, CountDistinct, Nothing) = CountDistinct(Fields!grp.Value, "DataSet1") and CountDistinct(Fields!grp.Value, "DataSet1") < 10)
, false
, true)
So now the expression will show the for the 10th row, or if the total number of groups in the DataSet are less than 10, it will show for the last group row.
It's a bit more complicated but it has worked for me in the past; depending on your data and report setup you might need to play around with the Scope a bit to get it working in your environment.
If you just need a total for those top 10 and not a running total, you can filter your table by top N ProductCategory and sort your ProductCategory group by SalesVolume Z to A.
For example, I have a table of sales orders and subtotals. I'm showing the top 10 highest total
I sorted by SalesOrderID group descending by my value (TotalDue). Then I filtered my table so it shows only top 10 SalesOrderID.
If you have a lot of data, you may have to see how this performs since I think the table filter happens at runtime.
I think I found an easy way to do that. I had many "Sums" in my report and I couldn't understand the way you answered.
The way i found was to create a parent group of the Details group and add a total row outside the Details. Then I hided the Detais group and the total group just did the Sums and in the group properties just needed to filter the final Sum top N rows, and sort by Z to A the Sum.
All of this worked fine and was done in the Group Properties! In the tablix poperties only showed 3 or 4 rows...

Resources