Changing font color when comparing fields in Report Builder 3.0 - reportbuilder3.0

Report Builder 3.0
I have 2 columns - one is est hours - one is act hours
I want to change the hours in the act to "red" when it is higher than the estimate hours
I have tried the following
IIF(Fields!AcutalHours.Value > Fields!Estimate_Hours.Value "Red"
and I have tried the following
=Switch(Fields!Estimate_Hours.Value < Fields!AcutalHours.Value, "Black"),
=Switch(Fields!AcutalHours.Value > Fields!Estimate_Hours.Value, " Red ")
I am using the font expression

Are the fields definitely Numeric? Try converting them to Int to ensure it's comparing them as numbers.:
=Iif(CInt(Fields!ActualHours.Value) > CInt(Fields!Estimate_Hours.Value), "Red", "Black")

You can add a new calculated field to your Dataset in ReportBuilder with a formula like this:
=IIF(InStr(Fields!Original.Value,Fields!Updated.Value)>0, "White","Red")
Once that is done, Select the properties of the field that needs to be formatted, select fill, formula and set the expression for the BackgroundColor to
=Fields!MyCustomDiffField.Value
I use this method of formatting in Report Builder 3.0

Related

Sorting stacked bar chart based on the values ( highest to lowest) in Tableau

I am using working on Tableau stacked bar chart.
The bar chart represents the total %. Therefore, the length of bar chart is equal.
Now I would like to sort the dimension (referee) based on the values of legends ( highest to lowest).
can anyone suggest me how to do it.
I also attached the packaged workfile here
Here is the picture of sort screen;
Level of data source below:
Below is the screen shot based on the final answer provided:
Thanks,
Zep
So to get this you first need to get a calc field that gets the win %:
SUM(IF [FTR] = 'AWins' OR [FTR] = 'Hwins' THEN 1 END)/COUNTD([Game ID])
This can then be used to rank the referees:
Now the reason that it may not be working for you with your technique is that you're sorting on COUNTD(Wins) which is the total number of wins, not the percentage wins for the ref. So someone that has just played more games may come up higher in the rank
Now you have the calc field, you can go back to your report and sort on the new field:
I rearranged the legend so you can see that the ref with the best % wins are shown first (red and blue bars)
If you don't want it sorted by win %, then change the calc field to:
SUM(IF [FTR] = 'AWins' OR [FTR] = 'Hwins' THEN 1 END)
For the COUNTD of games, if you only have the date and the game available and want to create an ID from that that is unique, create a calc field like this:
game-date-id = STR([game]) + STR(' ') + STR(date)
This will then be used in your COUNTD if statement:
SUM(IF [FTR] = 'AWins' OR [FTR] = 'Hwins' THEN 1 END)/COUNTD([game-date-id])
I have attached the picture of the dashboard.
I want to sort the referee based of Hwin
Yeah. It did not work out as expected

using icCube HSL color formula to set the color for the amChart values

Following the answers on my previous question in June, I would like to use the icCube HSL() formula to define the colors of the chart members in the amChart widget.
In the standard schema Sales I use the following MDX:
with
member [measures].[hue] as 16
member [measures].[saturation] as 1-indexof([Rubriek].[Rubriek].currentmember.siblings,[Rubriek].[Rubriek].currentmember)/30
member [measures].[lightness] as 0.2+ordinal(level([Rubriek].[Rubriek].currentmember))/10
member [measures].[color-hsl] as hsl([hue],[saturation],[lightness])
member [measures].[color-fixed] as "#FF0000"
SELECT
{ {[Measures].[Amount],[measures].[color-hsl],[measures].[color-fixed]} } ON COLUMNS,
{ [Product].[Product].firstNotAllLevel().allmembers } ON ROWS
FROM [Sales]
I have added 2 color fields:
color-hsl = the HSL defined color based on level depth of the product hierarchy and the position of the member among its siblings
color-fixed = just a hexadecimal color, for testing purposes
Now when I define a combo chart, I can set the color field in the 'Advanced properties':
[{"colorField":"color-hsl"}]
Except, this does not give me the calculated colors. But, if I change the colorField to color-fixed it gives me the red color as defined.
Questions:
How can I achieve that the color-hsl is working. Do I have to convert it to a hexadeximal string? How can I achieve that?
How can I get rid of the data value for color-hsl. I only want to use this as a field to define the color, not the value (that is the "Amount") field in my mdx?
The color function in MDX returns an integer value, e.g. 2334. If you want to use it in a browser you've to convert it to the hexadecimal string representation :
ToHexColor( colorAsInteger ) that returns

Can you make the bubble size and color dependend on a MDX measure in icCube amChart widget?

I am trying to make a dynamic chart in icCube, in which bubbles are sized and colored in accordance with a specific data field in the MDX result set.
Example MDX result set:
(the x/y coordinates have been removed for the sake of simplicity):
amount color bullet size
Swiss 100 #0000FF 10
Spain 120 #FF0000 12
NL 70 #00FF00 7
I do not know how to do this now in the amChart widget in icCube, but I know it is possible to do this in amCharts itself. You can set for example the following attributes in the amCharts editor:
Alpha field, Bullet field, Bullet size field, Description field, Fill colors field, Label color field, Line color field, ... etc (see for more in the amCharts live editor).
Enclosed a sample chart with two series, in which one has colored bubbles:
example
Is it possible in icCube web reporting to do this, and if so, how?
Yes it is possible:
The table should look like this:
In your amCharts bubble widget, add the following in Graph:
"colorField":"color" //the name of the column that contains the colors
and set use mdx colors to "no".
I named my colorField "kleur". Any value here is possible, but it has to be the same as the column name that contains the colors.
Yes you can, just you have to write the following into the "Extra Options" field:
:{
graphs:[{
xField: "your_x_field",
yField: "your_y_field",
valueField: "amount",
bulletSizeField: "bullet size",
bullet : "round",
colorField: "color"
}]
}
Note that, your graphs defined above will be overwritten by this one, you have to specify here all the graph settings.

Category colors in SSRS chart

I have a bar chart in SSRS that has one category group and no series groups. What I would like to know is if there is any way I can have each category show up as a different color, rather than all of them being a single color like SSRS wants to do?
The only way I know of to do this is to hard code the colors for each category in the Values' Properties -> Fill tab -> Color expression:
=IIF(Fields!DISPUTE_TYPE.Value = "Duplicate", "Red",
IIF(Fields!DISPUTE_TYPE.Value = "Eligibility", "Orange",
IIF(Fields!DISPUTE_TYPE.Value = "Corrected billing", "Green",
IIF(Fields!DISPUTE_TYPE.Value = "Additional information - Records", "Blue", "Yellow"))))
The downside is that you have to account for all values else they'll use the last "default" value (yellow in this code).
You could number each type in your query and use that number in a formula to create colors.

DC.js Choropleth filtering Issue

I am trying to filter data on my choropleth chart from a bargraph. Strange thing is that it is not showing correct value on selecting a bar from the accompanying bar chart.
Here is the jsfiddle: https://jsfiddle.net/anmolkoul/jk8LammL/
The script code begins from line 4794
If i select WIN004 from the bar chart, it should highlight only five states and the tooltip should reflect the values for the data. Some states are highlighted for whom WIN004 does not exist.
I changed the properties of the choropleth from
.colors(d3.scale.quantize().range(["#F90D00", "#F63F00", "#F36F01", "#F09E01", "#EDCB02", "#DDEA03", "#ADE703", "#7EE404", "#50E104", "#24DE05", "#05DB11"]))
.colorDomain([-1, 1])
To
.colors(d3.scale.linear().range(["green", "white", "red"]))
.colorDomain([-2, 0, 2])
But i get a lot of white states where its hard to discern what has been highlighted. The tool tip for some white-ed-out states show -0.00 :/
Here is the fiddle http://jsfiddle.net/anmolkoul/jk8LammL/1/
So i guess either its a problem with my color range or how my data is getting parsed.
I would ideally like to specify the data ranges in the .colorDomain based on the top and bottom values of the riskIndicator dimension. My functions are not working though. Should i use d3.max or riskIndicator.top here?
EDIT:
I got the color domain dynamic by using the min and max values but still the graph is not performing as expected? Could this be an issue with the geochoropleth chart? I further took a working geochoropleth example and ported my data to it and even that gave me the same issue of representing data incorrectly. I thoughit could be a data problem but i validated using a couple of good BI tools and their map charts displayed data correctly.
Could this be an issue with the dc choropleth?
Thank you.
Anmol
This has the same root cause as the issue in this question:
Crossfilter showing negative numbers on dc.js with no negative numbers in the dataset
In short, floating point numbers don't always cancel out to zero when added and subtracted. This "fake group" will ensure they snap to zero when they get close:
function snap_to_zero(source_group) {
return {
all:function () {
return source_group.all().map(function(d) {
return {key: d.key,
value: (Math.abs(d.value)<1e-6) ? 0 : d.value};
});
}
};
}
Added it to the FAQ!

Resources