Y Axis label for first datapoint only
SSRS2008 R2. On the primary Y Axis I want to display just a single label which is the first value plotted. That would result in a label right next to the first datapoint. Setting Chart Axis/Interval to =First(Fields!PGUsers.Value) shows
the label I want be also labels for zero and multiples of First(Fields!PGUsers.Value). If I set Axis Mimimum to =Min(Fields!PGUsers.Value) to suppress the zero then the label no longer respects the interval property and displays the min value instead.
This will be due to the chart always displaying the first and last values. I cannot turn off display first and last as that resutls in no labels most of the time.
There may be a formula for Chart Axis/HideLabels such as =iif(Fields!PGUsers.Value = First(Fields!PGUsers.Value),False, True) but it does not work?
How to display just one label which is the first value?
May 19th, 2011 10:51pm
Hi,
Do you mean you need to only display the Y-Axis label like the following picture shows? If I have misunderstood, please point out.
In order to achieve this, please refer to the steps of my example.
1.
There are 2 data fields OrderQuantity and Category in the dataset.
I specify the OrderQuantity to the ∑Values of the chart, and specified the Category field to the Category Groups of the chart.
2.
Select Y-Axis.
In the Properties pane,
-Specify the Interval property to the expression
=Max(Sum(Fields!OrderQuantity.Value,
"Chart1_CategoryGroup"))
-Specify the IntervalOffset property to the expression
=First(Sum(Fields!OrderQuantity.Value,"Chart1_CategoryGroup"))
-Specify the Max
=Max(Sum(Fields!OrderQuantity.Value,
"Chart1_CategoryGroup"))
Please change the field name and chart category name in the expressions based on you report.
Thanks,
Tony Chain
Tony Chain [MSFT CSG] | Microsoft Community Support
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2011 10:50pm
Yes Tony, that is the look I'm after.
My graph is nested in a table so I'm not including the dataset name as nested aggregates are not permitted. i.e: =Max(Fields!OrderQuantity.Value) for the Interval property. Following your instructions I get the label I want but also a second
label of a negative value. For example if the label I want is 47,351 the negative label is -3,308?? Setting the minumum to zero fixes that but what I want is to set the minumum to =Min(Fields!OrderQuantity.Value) which does not work as I then get
no labels at all. Setting the minumum to =Min(Fields!OrderQuantity.Value)/2 to make it something lower also results in no labels?
How to set the axis minimum to Min(Fields!OrderQuantity.Value) while retaining the 1 label look?
May 22nd, 2011 11:36pm
Hi Colin,
I ran into a similar problem in that we wanted to display a label only on the last data point of the X-axis.
The SQL query included a "SORT" field defined as ROW_NUMBER() OVER(ORDER BY SALES_DATE) as SORT. The SORT column then contains values 1, 2, 3, ... 10
I set the Label value to =iif(Fields!SORT.value = MAX(Fields!SORT.Value), Fields!OBJETIVE.Value, nothing)
which did not work. It seems that whenever there is an aggregate "MAX" function, the IIF condition Fields!SORT.Value = MAX(Fields!SORT.Value) always returned true, instead of only being true for the last MAX_SORT value = 10.
The workaround was to add a column to the SQL Query to calculate MAX_SORT : (select MAX(SORT) FROM WORK_TABLE) as MAX_SORT.
I then changed the Label value to =iif(Fields!SORT.Value = Fields!MAX_SORT.Value, Fields!OBJECTIVE.Value, nothing)
This worked fine in displaying the Fields!Objective.Value only on the last data point, where MAX_SORT = 10.
You might consider using this "trick" by adding a MIN_PGUSERS value to your SQL Query (Select MIN(PGUsers) FROM ...) as MIN_PGUsers and then adding a test to display only the first data point: =iif(Fields!PGUsers.Value = Fields!MIN_PGUSER.Value, False,
True)
Good luck
Best regards, Christopher Sorensen
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2011 7:15pm
Hi Colin,
I ran into a similar problem in that we wanted to display a label only on the last data point of the X-axis.
The SQL query included a "SORT" field defined as ROW_NUMBER() OVER(ORDER BY SALES_DATE) as SORT. The SORT column then contains values 1, 2, 3, ... 10
I set the Label value to =iif(Fields!SORT.value = MAX(Fields!SORT.Value), Fields!OBJETIVE.Value, nothing)
which did not work. It seems that whenever there is an aggregate "MAX" function, the IIF condition Fields!SORT.Value = MAX(Fields!SORT.Value) always returned true, instead of only being true for the last MAX_SORT value = 10.
The workaround was to add a column to the SQL Query to calculate MAX_SORT : (select MAX(SORT) FROM WORK_TABLE) as MAX_SORT.
I then changed the Label value to =iif(Fields!SORT.Value = Fields!MAX_SORT.Value, Fields!OBJECTIVE.Value, nothing)
This worked fine in displaying the Fields!Objective.Value only on the last data point, where MAX_SORT = 10.
You might consider using this "trick" by adding a MIN_PGUSERS value to your SQL Query (Select MIN(PGUsers) FROM ...) as MIN_PGUsers and then adding a test to display only the first data point: =iif(Fields!PGUsers.Value = Fields!MIN_PGUSER.Value, False,
True)
Good luck
Best regards, Christopher Sorensen
June 20th, 2011 7:15pm
Hello
I am running into troubles thinking if there is a way to format a specific label of any axis regardless the values, let see the sample in the picture attached.
https://skydrive.live.com/?cid=d42ba6801d9842f8&sc=documents&uc=1&id=D42BA6801D9842F8%21431#cid=D42BA6801D9842F8&id=D42BA6801D9842F8%21432&sc=documents
I would like to have both marked axis lines to have different format (color, label font weight), I tried to do this by setting the properties of "major grid lines" item bubt could not get whtat I am looking for.
I would appreciate your advice, best regards
--
Douglas
Free Windows Admin Tool Kit Click here and download it now
June 27th, 2011 4:31pm