a percentage values in crystal report - charts

I have values in database witch is a percentage values for example:
Per columns : 90,85,38,70,85
I select “Per” as the value to be shown in the bar chart
But when I run my crystal report all my bar display as 100%
It does not take the exact value of “Per”
How can I solve this problem?

If your column values are whole numbers then you should probably create a formula to calculate the fraction. Then you should be able to display as a percentage. Eg. {table.fieldname} * .01

Related

Percentage of total changes on applying filter

I have a data table with three dimensions and one measure. For each row, I am trying to calculate the percentage of total (calculated by taking the sum of rows) using a calculated field.
As seen in the screenshot attached, For the column titles 'Dec-19' I want the values to be a percentage of current value / grand total (calculated at the bottom as 122,187)
Screenshot of DataTable:
So e.g. for the Column B value of 2000, the Dec-19 column should be (97/122,187) * 100 = 0.079.
I have achieved this by creating a calculated field with the formula: SUM (sales) / MAX ({EXCLUDE (Column B): Sum (sales}), where sales is the measure used in the datatable.
However, upon application of filter on column B, the percentage value changes. e.g. if I select the value 2000 in my filter for column B, I get the percentage as 100%. It seems as if the percentage is being calculated based on only the rows in the filter.
Since you haven't included any sample data, I created some sample data like this, hope this resemble yours.
Thereafter, I built a cross-tab view in tableau, somewhat like yours
If that is the scenario, use a calculated field, say CF like this, instead of yours
([Sales])/
{FIXED [Col1], DATETRUNC('month', [Col3]) : sum([Sales])}
Dragging it in the view
and thus, filtering won't affect your calculation

How do I set decimal number format in percentage total format on Cross-Tab report table

Crystal Reports 11.5 - I have tried to format the % objects in the cross-tab table to show 1 or 2 decimals but it is not saving. As a result the values are all rounded and so the sum of the sub totals does not add to 100% (sometimes only 97%) even the GT shows 100%.
How do I edit the format and save this?image show table sample with wrong values

Tableau calculate percentage from a value in the table

I'm trying to calculate the percentage in Tableau from a value in a table.
For example. I have a table that contains the following
Name Value
a 10
b 20
c 30
Ref 100
How can I have the percentages calculated based on the Ref value like for example a/Ref
Name Value Percentage (x/Ref)
a 10 10%
b 20 20%
c 30 30%
Thanks
You can either
use tableaus built in functionality:
Right click the measure pill and select "quick table calculation -> Percentage of total"
2.Use calculated fields.
Create a calculated field(Analysis->Create Calculated Field) called reference. As the value enter the integer you want.
Create a second calculated field call it percentage. Here enter the mathematical formula to get a percentage using the reference calculated field as your total.
So something like:
[Value] / [refrence] *100
You don't need the reference calc field, you could just hard code the value into the calculation.
Drag the percentage calculated field into the row shelf.

Tableau: Plot percentage of binary column

Simplified example: column of 'measure' data is binary 0's and 1's. The sum of the column (all the 1's summed) is 3948. The length of the column is 4567. 3948 is 86% of 4567. How do I create a bar chart showing this percentage. All I can get is a bar adding up to 100%.
I've tried absolutely everything in the percentage of dropdown, calculated fields, online tutorials, etc.
Two approaches:
Right click on your measure field on whichever shelf you placed it. Choose Quick Table Calc -> Percentage of Total. Experiment with different settings for "Compute Using" and read about addressing and partitioning of table calculations to learn how to specify percent of "what".
Or create a calculated field specific to your problem defined as below:
sum(int([my measure field] = 1)) / count(1)
Be sure to set the default number format for your calculated field to a percentage, by right clicking on it in the data pane (left margin) and revising the default properties
Note, the second calculation works because the INT() function converts True to 1 and False to 0, which is useful in several contexts.
You can go about this using the following method
Add 'measure' to Columns and make it a Discrete Dimension
Add SUM(Number of Records) to Rows. This should give you the bar chart you need.
This would help achieve what you are looking to do. For more customization and a better look for the graph you are looking to build in Tableau.
Add 'measure' to the colour legend and make it a Discrete Dimension.
Add SUM(Number of Records) as a Label and do a '% of Total' quick table calculation.

Sum of Formula field

I have two values: Value and Percentage. To calculate the total, I just need to create a formula like this one:
({table.value} / 100.00) * {table.percentage}
My report shows the amount of sales grouping by product:
Value----------Percent-----------Total
Sum of Value---???---Sum of the formula above
The problem starts when I need to show the percent value grouped by products, I can't simply show a Sum of Percent and showing the Medium displays wrong value.
*Correct total based on the percentual.
For example, the second line of the table shows values grouped by product, as you can see, simply calculating the Medium shows 6,34 when it should be showing 8,32.
So, I was thinking about creating another formula, just to calculate the Percent value when grouped, like this:
Sum ({#Calculated}, {product.product_id}) / Sum ({table.value}, {product.product_id}) * 100
When previewing, it shows the correct values, but when running, it throws an exception telling me that I can't Sum the {#Calculated} because it needs to be bound to a grouping.
Is there any way to recalculate the percentual value based on a formula?