How do you specify number format on a bar graph in Crystal Reports? - crystal-reports

In chart expert, Number Format is greyed out unless you explicitly set a min and max value for the chart. I have no idea why those two options are coupled together and it makes NO sense at all. Is there any way I can have my values represented as currency without picking arbitrary min/max values for the data ranges?

You're just looking in the wrong place. Click on one of your axis labels (the numeric axis you want to change) and then right-click it and select "Format Axis Label". If you look under the "Number" tab, you can change the "Category" to currency and format it however you want.

Another method if you want even more control is to use a formula..
totext({tablename.fieldname}, 0) + "%"
"£" + totext({tablename.fieldname}, 0)
Etc. These will give you full control over the appearance of your data. (note you should use this for grouping fields [ie week number], not for quantity fields [ie sales]).

Related

Birt Reports - Adding percentages to chart legend

Is it possible to add percentages to the chart legend, or is it the only way to put percentages to the chart, by adding the "Percentile Value Data"?
Thanks for your help in advance.
AFAIK the percentile value is usually something different, it only makes sense if the categories are based on intervals, e.g. given 7 billion living humans and measuring their age, the top 0.1 percentile are the 7_000_000_000 * 0.1/100 = 7_000_000 oldest living humans.
So, percentile values make sense for things you can measure, like age, income, length - in other words, numbers, or at least things which can be ordered.
You wouldn't use a pie chart then.
Percentile values don't make sense for things that cannot be measured like car labels.
Take a look at https://forums.opentext.com/forums/developer/discussion/48914/how-to-create-pie-chart-with-percentage-instead-of-values
M Williams writes there (I just repeat this here):
In the chart editor, you can go to the "format data" tab, then to the value series section, click on the "labels" button at the bottom, delete the "value data" option from the values window, then from the dropdown below the window, choose the percentage option and add it. This will show your pie chart labels in percentage.

Calculating % Complete

enter image description here
From the Image I need to calculate % complete for the order number 1.
Calculation for complete will be
(total number of points for status 'Delivered' / total number of points)*100
The value should be 57%
Can some one help with the calculated field?
Look at IIF in help files
SUM(IIF([Status]="Delivered",[Point],NULL)) / SUM([Point])
I assume your column named Order No. extends all the way down each row (i.e., each row should have a 1 as Order No. but the screenshot does not show that.
Also, the above only works if the status of "Delivered" is consistently cased, which it is not in the screenshot. If it is not consistently cased, wrap [Status] in an Upper function:
SUM(IIF(UPPER([Status])="DELIVERED",[Point],NULL)) / SUM([Point])
You can also get the effect you want, just by manipulating the Tableau user interface -- without needed to write calculated fields as #S. User18 showed. Both approaches work, but it helps to understand both alternatives.
As with #S. User18, I assume your column named Order No. is consistently filled in. I also assume [Order No.] is a dimension.
Place [Order No.] on a shelf, say Rows
Place [Status] on another shelf, say Columns
Place Sum([Point]) on a shelf, say Text
This shows the sum of the number of Points for each combination of the two dimensions: [Order No.] and [Status]
To convert the number of Points to a percentage, right click on Sum([Point]) on the marks card, and choose Quick Table calculation->Percent of Total
Similarly, right click on Sum([Point]) and experiment with different "Compute Using" settings to get the effect you want -- i.e. percent of each row, column, table etc. You can instead Edit the Table Calc if the preset Compute Using options don't get the effect you want.
Right click on any row or column headers that you want to hide - so if you only want to display the percentages for the Completed Status, hide the others. Don't exclude the others as that will change the calculations.
To understand more about Table Calculations, see the online help.

Specify number of decimals in crystal reports chart axis

Am I just blind or is this basic feature very hidden?
I'm creating a chart in Crystal Reports XI which has value on the x-axis and distinct count on y-axis (aka histogram).
The problem is this: I get two decimal places on the x-axis values even though the numbers are integers. How can I specify the number of decimals for the x-axis? Right clicking gives no format option as right clicking data fields usually does.
Edit:
This is the look of the axis tab in the chart expert. No number format or auto range for the x axis.
It may have changed as i'm on the latest version of Crystal. Does yours not look like this?
In crystal Xi , chart expert , tab axes, untick auto range, and choose number format
(screenshot refused to new users, sorry mate)
Hope this helps
For Crystal report 13 write the crystal report formula
ToText({fieldname}, 0, "")
0 truncates the decimal, and "" removes the thousands separator.

Create a Crystal Report cross-tab 'header' label

I'd like to create a 'header' label that 1) is centered over the cross-tab and 2) grows with it. Unfortunately, CR 2008 (or earlier for that matter) doesn't have this feature.
In image (below), I've added a text field above the cross-tab, but I can't think of a way to get it to grow/shrink (horizontally) with it.
If you're able to calculate, say by a summary function, the number of columns you will have then you can do this:
In your crosstab, check to see the width of your columns. The columns should be set widths. Edit: The crosstab adds some padding, so you will have to figure out the column width by measuring in Crystal with another field and eyeballing until it's close enough to work
Right-click on your label, and hit "Size & Position".
Add a new formula for the "Width". The X,Y positions should stay the same.
Use the summary function (You could create a SQL Expression or formula that only shows the month/year of your date fields and then distinctCount() them) to find out how many columns you will have multiplied by the width of each column. This will take some trial and error for sure, but I don't see why it wouldn't work.

SSRS chart does not show all labels on Horizontal axis

My SSRS report does not show all the labels on the horizontal axis. Please see below.
Note how the red arrows point to the few that do show. So my question is, where are the rest of the labels? Each bar should have one.
For the chart I'm adding number data for the bars, and another field for the Category Groups. That field in Category Group is for the labels.
Does anyone know why some are missing?
Also, a second but less important question, why is the order of the bars not the same order as the dataset?
The problem here is that if there are too many data bars the labels will not show.
To fix this, under the "Chart Axis" properties set the Interval value to "=1". Then all the labels will be shown.
Go to Horizontal axis properties,choose 'Category' in AXIS type,choose "Disabled" in SIDE Margin option
It looks as though the horizontal axis (Category Group) labels have very long values - there may not be room to display them all. I suggest changing the labels to have shorter values.
You can set the sort order for the Category Groups in the Category Group Properties - Sorting section - this may have been previously set; if not, I suggest using this to sort as desired.
(Three years late...) but I believe the answer to your second question is that SSRS essentially treats data from your datasets as unsorted; I'm not sure if it ignores any ORDER BY in the sql, or if it just assumes the data is unsorted.
To sort your groups in a particular order, you need to specify it in the report:
Select the chart,
In the Chart Data popup window (where you specify the Category Groups), right-click your Group and click Category Group Properties,
Click on the Sorting option to see a control to set the Sort order
For the report I just created, the default sort order on the category was alphabetic on the category group which was basically a string code. But sometimes it can be useful to sort by some other characteristic of the data; for example, my report is of Average and Maximum processing times for messages identified by some code (the category). By setting the sort order of the group to be on [MaxElapsedMs], Z->A it draws my attention to the worst-performing message-types.
This sort of presentation won't be useful for every report but it can be an excellent tool to guide readers to have a better understanding of the data; though on other occasions you might prefer a report to have the same ordering every time it runs, in which case sorting on the category label itself may be best... and I guess there are circumstances where changing the sort order could harm understanding, such as if the categories implied some sort of ordering (such as date values?)
Really late reply for me, but I just suffered the pain of this problem as well.
What fixed it for me (after trying the Axis label settings and intervals from those screens, none of which worked!) was select the Horizontal Axis, then when you can see all the properties find Labels, and change LabelInterval to 1.
For some reason when I set this from the pop up properties screens it either never 'stuck' or it changes a slightly different value that didn't fix my issue.
image: reporting services line chart horizontal axis properties
To see all dates on the report;
Set Axis Type to Scalar,
Set Interval to 1
-Jump Labels section
Set disable auto-fit
set label rotation angle as you desire.
These would help.