IATI / D-Portal

http://d-portal.org/
Other
30 stars 23 forks source link

result/indicator/@ascending boolean is not used when false #547

Open stevieflow opened 4 years ago

stevieflow commented 4 years ago

When a result has an indicator with ascending attribute set to false, d-portal doesnt seem to visualise this as expected

ascending boolean: :

A boolean describing the behaviour of the indicator. It is “true” if the indicator improves from small to large (e.g. clinics built); false if it improves from large to small (e.g. cases of a disease).

Example (I could only find this one in live data - but have tested this in private previews):

d-portal (7)

XML for this indicator:

<indicator measure="1" ascending="false">
<title xml:lang="en">
Number of community members counselled and tested for HIV
</title>

In this instance, we'd expect that as the actual value exceeds the target, but the ascending boolean is set to false (ie : the actual should be less than the target) then the shade of green here should be similar to the one used in instances where actuals do not meet targets...

NB: have also tested with the boolean set to "0", but same outcome

xriss commented 4 years ago

The ascending flag is a bit of a useless piece of information really. We can work it out from a baseline and a target so that is what we do.

I've added a hack where if no baseline is provided and ascending is set to false and a target is provided then we take a guess at a baseline which is slightly higher than the given target. The rest of the time it will be ignored.