this should do it
if ( [total] <= 100, RGB (0,128,0), // if less than 100 than green
if ([(total] <= 115, RGB (255,255,0), // else if less than 115 then orange
RGB (255,0,0))) // else red
rgb() is a function so teh parenthisis go around the arguments.
bewrae that id your total has got decimal places you will have to tweak the conditions.
what do you mean you cannot get it to do exactly what you want?
What kind of values are you getting in the [total] as this is what we are comparing against? Can you show some of those values here?
Is it a decimal? why have you changed the range to 0.1, 0.115? Is [total] a percentage? or do you have values like 100.1, 115.05 etc. ?
you can remove the decimal part in the conditional expression by doing this floor([total]) without touching your actual expression.
Sometimes these color codings can be misleading especially on the boundaries as the underlying number may be different to the displayed figure - due to rounding/formatting etc.
could you post an example of your qvw?
I orignally used this statement on a pivot chart loaded from excel where it ws formatted as a number , as ws the chart in Qlikview.
I wish to use it now in another Pivot chart where the data in Excal is formatted as Percentage and in chart its as percentage with 1 decimal place .
This is the statement as amended:
It is resulting in all the background colours being RED ( Which is the or else part of the condition)
Do you reckon its something with how the data is formatted in the load ?
well everything is certainly being evaluated as being larger than 0.115, that is for sure!
it is hard to tell without seeing the data but as said before formatting means what you see is not necessarily what you get.
In your document do a right click and "select fields" and selct the filed you are measuring aginst. thsi will give you a list box withe the values in the field as they appear with their default formatiing.
what does this look like?