# DHIS2 zscorewfh showing wrong result

**URL:** <https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435>\
**Category:** Implementation - Implémentation\
**Tags:** android\
**Created:** [3 November 2022 11:42 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435 "2022-11-03T11:42:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmed\_qaid](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/ahmed_qaid/32/36863_2.png) [@ahmed\_qaid](https://community.dhis2.org/u/ahmed_qaid)\
**Post date:** [3 November 2022 11:42 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435/1 "2022-11-03T11:42:08Z")

</div>

In DHIS2 zscorewfh takes 3 inputs (height, weight and gender) but the problem is that, when using DHIS2 mobile app if height and weight is a whole number zscorewfh will be calculated but if a fraction is there zscorewfh returns empty besides when using zscore in website capture app a discrepancy is there between WHO anthro calculator and DHIS2 zscore so is there anybody facing that problem and solved it.

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [4 November 2022 13:41 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435/2 "2022-11-04T13:41:10Z")

</div>

Hi @ahmed_qaid

Which app are you using? Could you share an example with the use case that could be reproduced?

Thank you!

---

<div class="post-metadata">

**Author:** ![ahmed\_qaid](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/ahmed_qaid/32/36863_2.png) [@ahmed\_qaid](https://community.dhis2.org/u/ahmed_qaid)\
**Post date:** [8 November 2022 15:09 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435/3 "2022-11-08T15:09:32Z")

</div>

Sorry for late, the problem with android app when using zScoreWFH function is that, if the height is an integer number you’ll get the result but if it is a float number like 63.2 you’ll get nothing I uploaded some pics to let you get the problem.

 ![IMG-20221108-WA0004](https://dhis2.b-cdn.net/uploads/default/original/3X/f/8/f82333a1f9c6cf3fe698a4e679b61a3436ab0dec.jpeg)  
 ![IMG-20221108-WA0005](https://dhis2.b-cdn.net/uploads/default/original/3X/3/a/3ac5a2e280ac8b13b931eef63f4d8503a0f9fdbc.jpeg)  
 ![IMG-20221108-WA0002](https://dhis2.b-cdn.net/uploads/default/original/3X/4/f/4fe0197bb4b2b5c3e8c8a65c422bea31c6b31ecc.jpeg)  
 ![IMG-20221108-WA0003](https://dhis2.b-cdn.net/uploads/default/original/3X/4/c/4cbf258588c86de7293ab02bbb93c2ad907b37a3.jpeg)

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [8 November 2022 15:43 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435/4 "2022-11-08T15:43:57Z")

</div>

Please share the data element type for the field you are entering the zScore into as well as the program rule expression. (From Maintenance app)

Thank you!

---

<div class="post-metadata">

**Author:** ![ahmed\_qaid](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/ahmed_qaid/32/36863_2.png) [@ahmed\_qaid](https://community.dhis2.org/u/ahmed_qaid)\
**Post date:** [8 November 2022 20:51 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435/5 "2022-11-08T20:51:31Z")

</div>

![DataElement](https://dhis2.b-cdn.net/uploads/default/original/3X/3/2/327fe91e0f9bb1f86966c50f2bcc9ad666ca98e9.jpeg)  
 ![ProgramRule](https://dhis2.b-cdn.net/uploads/default/original/3X/8/e/8e5b31f3cbf703448b7fc1d85c25e82318eed18a.jpeg)

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [9 November 2022 08:53 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435/6 "2022-11-09T08:53:29Z")

</div>

> [@ahmed\_qaid](#):
>
> ![DataElement](https://dhis2.b-cdn.net/uploads/default/original/3X/3/2/327fe91e0f9bb1f86966c50f2bcc9ad666ca98e9.jpeg)

#### English:

 ![image](https://dhis2.b-cdn.net/uploads/default/original/3X/e/f/ef068de731a399defa9f1bcc894ac9c516dc93e6.png)

* * *

And please what about the ‘Program rule details, and program rule expression’:

 ![690x227](https://dhis2.b-cdn.net/uploads/default/original/3X/6/8/687b0c5c727d99944fe00113ae101118529425f7.png)

---

<div class="post-metadata">

**Author:** ![ahmed\_qaid](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/ahmed_qaid/32/36863_2.png) [@ahmed\_qaid](https://community.dhis2.org/u/ahmed_qaid)\
**Post date:** [9 November 2022 10:35 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435/7 "2022-11-09T10:35:06Z")

</div>

![program Rule Details](https://dhis2.b-cdn.net/uploads/default/original/3X/7/f/7f2532a7ef33200277a7072f48d9798355e0bce0.jpeg)  
 ![Program Rule Expression](https://dhis2.b-cdn.net/uploads/default/original/3X/9/b/9bef7e31197f9709f18009218ed792695924db4a.jpeg)

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [10 November 2022 18:03 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435/8 "2022-11-10T18:03:42Z")

</div>

One thing that I would add to the program rule expression is to change it to:  
(#{NS Height} != ‘’) && (#{NS Weight} != ‘’) && (#{Gender} != ‘’)

I’m trying to reproduce this issue but I’m getting an error in the console, so I’m asking [@tracker-programRules](https://community.dhis2.org/groups/tracker-programrules) for support…

Program rule that assigns value of a function d2:zScoreWFH(#{Height},#{Weight},#{Gender}) to data element of type Number (and triggers when (#{Height} != ‘’) && (#{Weight} != ‘’) && (#{Gender} != ‘’)), shows this error… can’t read properties of undefined (reading ‘0’)

 ![image](https://dhis2.b-cdn.net/uploads/default/original/3X/0/8/087bab90ba9e3c930ccc531a37761f320b4df8b2.jpeg)

---

<div class="post-metadata">

**Author:** ![nancyesp](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/nancyesp/32/32641_2.png) [@nancyesp](https://community.dhis2.org/u/nancyesp)\
**Post date:** [11 November 2022 00:46 UTC](https://community.dhis2.org/t/dhis2-zscorewfh-showing-wrong-result/50435/9 "2022-11-11T00:46:39Z")

</div>

Hi @ahmed_qaid

I’ve been testing and it seems there is an error in the functions d2:zScoreWFA and d2:zScoreWFH. I’ve created this [jira issue](https://dhis2.atlassian.net/browse/ANDROAPP-5063), please feel free to add more information in the comment section if needed.

Thank you for your report. The team will try to fix it as soon as possible.
