Forum Discussion
Icon Conditional Formatting and Calculation Groups using Field Values
- 2 years ago
Ok I think I have discovered the root cause.
Because the underlying measure is originally of a type that is Integer, it is not adjusting to the type String that the Calculation Group is adjusting it to. And a field value source requires a measure to have a type of String.
So if I convert the measure to output a string initially and then do the switch on that through the Calculation Group it is now selectable.
So the problem is that the measure maintains it's original Data Type even if the Calculation Group is changing the output.
Hi Aklys ,
I believe that you need to have this formatting to be done automatticaly based on the measure that you have so you don't do any condittional formatting in the values, since the condittional formatting is done using a different process where you can select each of the values, having this on the calculation item does not avoid you to do it manually for each measure.
In this case and since your are doing just the normal icons I would do the KPI's calculation using the following way:
VAR _CF =
SWITCH (
TRUE (),
SELECTEDMEASURE () = 9000, UNICHAR(128994),-- "CircleHigh",
SELECTEDMEASURE () = 9001, UNICHAR ( 128993 ),-- "CircleMedium",
SELECTEDMEASURE () = 9002, UNICHAR ( 128308 ),-- "CircleLow",
UNICHAR ( 9899 )
)
RETURN
IF (
CONTAINSSTRING ( SELECTEDMEASURENAME (), "KPI*CF*CG" ),
SELECTEDMEASURE() & " " &_CF,
SELECTEDMEASURE ()
)
This will add the KPI on the measure it self.
This unfortunately doesn't resolve the issue I'm mentioning. I get you can use unichar instead but that solution comes with it's own problems. Such as it creates inconsistency of application throughout reports that use conditional formatting already for other things. Also the UNICHAR images are too different to align with other uses of the icon conditional formatting.
I wasn't looking for an alternative solution to applying the images, I was more trying to understand why that conditional formatting method doesn't work, this way I will know the limitations better of Calculation Groups. So I was wondering if any one knows if it's an order of operations or something else causing the experience.