Forum Discussion
AllanBerces
1 year agoPost Prodigy
If Zero Blank
Hi good day, can anyone help me to edit my code. I want to add if the targetpercent is 0 make it blank.
KPIArrow =
VAR up_arrow = UNICHAR(129137)
VAR down_arrow = UNICHAR(129139)
VAR KPI_ = [KPI_]
VAR KPI_Ave = [Ave.PT]
VAR TargetPercent = DIVIDE(KPI_Ave - KPI_, KPI_)
RETURN
IF(
TargetPercent <0, ROUND(TargetPercent*100,1)&"% "& down_arrow,
ROUND(TargetPercent*100,1)&"% "& up_arrow)
Thank you
AllanBerces All I can say is that it probably isn't exactly zero then but rather something like -.0001 for example.
4 Replies
- Greg_DecklerCommunity Champion
AllanBerces Try:
KPIArrow = VAR up_arrow = UNICHAR(129137) VAR down_arrow = UNICHAR(129139) VAR KPI_ = [KPI_] VAR KPI_Ave = [Ave.PT] VAR TargetPercent = DIVIDE(KPI_Ave - KPI_, KPI_) RETURN SWITCH( TRUE(), TargetPercent = 0, BLANK(), TargetPercent <0, ROUND(TargetPercent*100,1)&"% "& down_arrow, ROUND(TargetPercent*100,1)&"% "& up_arrow )- AllanBercesPost Prodigy
- Greg_DecklerCommunity Champion
AllanBerces All I can say is that it probably isn't exactly zero then but rather something like -.0001 for example.