Forum Discussion

gdave's avatar
gdave
Regular Contributor
7 years ago

Percentage Of

Hi all

 

In my SUT, the screen I am working on has two fields 1) Fund Value & 2) Tax Free Cash Limit

 

Now, the value in field 2 (tax free cash limit) is 25% of the value in field 1 (fund value).

 

Can anyone please advise how do I validate through property checkpoint or any other means that value in field 2 is 25% of value in field 1.  Your help is much appreciated.

 

Thanks

Gary

  • That was implied... the code expression can use the Alias mapping of your object including the property name.  So, where I have <value of field1> You could have

     

    Aliases.MyApp.MyForm.Field1.wText

     

    And this will then pull in the property value.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    You will need to use a code expression, no matter if you use a property checkpoint or whatever. 

     

    Basically, you're going to do a checkpoint where you're going to check the property of field two and see if it equals a code expression... something like

     

    aqConvert.VarToStr(<value of field 1> * 0.25)

     

    You might need to add additional code that would round to th nearest cent or something but tht would be the direction I take

     

    • gdave's avatar
      gdave
      Regular Contributor

      tristaanogre wrote:

      You will need to use a code expression, no matter if you use a property checkpoint or whatever. 

       

      Basically, you're going to do a checkpoint where you're going to check the property of field two and see if it equals a code expression... something like

       

      aqConvert.VarToStr(<value of field 1> * 0.25)

       

      You might need to add additional code that would round to th nearest cent or something but tht would be the direction I take

       


      Thank you for your inputs.

       

      Just to mention that the <value of field1> here is not static. It changes constantly so I was wondering if there is any way I can first get the value from field one and then calculate the percentage on the back of that value ?

       

      Thanks

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        That was implied... the code expression can use the Alias mapping of your object including the property name.  So, where I have <value of field1> You could have

         

        Aliases.MyApp.MyForm.Field1.wText

         

        And this will then pull in the property value.