Formula for RPN

Bernd Vollstaendig October 5, 2022

Hi,

I try to calc RPN. Here my (kind of normal) code:

 

// START CODE

reproducible_factor=1
priority_factor=1

RPN=0

IF (this.reproducible="Yes")
    reproducible_factor=2

IF (this.priority="Minor")
    priority_factor=0.5
else
        IF (this.priority="Minor")
             priority_factor=2

RPN = reproducible_factor * priority_factor

print(RPN)

 

// END CODE

 

Is it possible to do such calculations with FORMULAS ?

 

1 answer

1 accepted

0 votes
Answer accepted
Bernd Vollstaendig October 6, 2022

// Calc RPN

WITH Reproducible_Value = CASE(this.Reproducible, "No", 0.5, "Yes",2.1 ,0) :
WITH Frequency_Value = CASE(this.Frequency,"Once", 0.5, "Repeatedly", 1.0, "Always", 1.5 , 0) : WITH Priority_Value = CASE(this.Priority,"Lowest", 0.25, "Minor", 0.5, "Medium", 1.0 , "P3", 1.5, "Major", 2.0, "Blocker",3, 0) :

Reproducible_Value * Frequency_Value * Priority_Value

Suggest an answer

Log in or Sign up to answer