Policy Automation for B2C Service

Get Involved. Join the Conversation.

Topic

    Eric Muiruir
    Displaying Vehicle Depreciation Figure in Percentage Format
    Topic posted September 11, 2019 by Eric MuiruirRed Ribbon: 250+ Points 
    29 Views, 10 Comments
    Title:
    Displaying Vehicle Depreciation Figure in Percentage Format
    Summary:
    My Motor Vehicle Duty Calculator Results page has a figure that appears as a decimal instead of a percentage. Is there a way one can display this decimal number in percentage format?
    Content:

    Hi,

    My Motor Vehicle Duty Calculator Results page has a figure that appears as a decimal instead of a percentage. Is there a way one can display this decimal number in percentage format?

    See screen shot shared under the entry "Depreciation" (Circled in Red) it shows "0.95". I would wish to display this figure as a percentage instead of a decimal figure.

     

    Regards

    Eric Kiruthi

    Image:

    Comment

     

    • Jasmine Lee

      You could use concatenation, and then substitution in a screen label to achieve this. For example, let's say there's an attribute "the depreciation factor" (or whatever your attribute is that represents the depreciation percentage).

      1. Create a text attribute: "the depreciation factor (display value)".

      2. Set the value of the new text attribute using the Concatenation and Text functions:

      the depreciation factor (display value) = the concatenation of Text(the depreciation factor * 100) + “%”

      3. In the Edit Attribute window for "the depreciation factor (display value)" in the Data tab of OPM, add a Name for the attribute, e.g. "DepreciationFactor" (or whatever matches your naming convention).

      4. Use substitution on the screen label, e.g. Depreciation = %DepreciationFactor%.

      5. If the depreciation is calculated to be 0.95, the label will display like this:

      Depreciation = 95%

      I just tested this and it worked as expected.

      Cheers,
      Jasmine

      • Eric Muiruir

        Hi

        I have followed your steps and now the Depreciation value displays "Unknown"

        I have attached a screen shot of the table i have been using to calculate depreciation for Direct imports.

        It is from these table that i am getting the depreciation figures that i wish to display as percentages on the Results Screen.

         

        Regards

        Eric Kiruthi

        • Jasmine Lee

          Hi Eric,

          I was going to attach an example project with it working as expected, but it looks like the forum won't allow attaching zip files. Then I tried attaching several screenshots showing the key parts, but the forum also won't let me attach multiple images to a reply (frustrating!). So now I'm going to try posting the screenshots as separate replies. Take a look and see if it explains things.

          In my example, if the number of months is unknown, then the depreciation percentage is unknown (which is expected). If the number of months is set, then the depreciation percentage displays on the summary screen.

          Cheers,
          Jasmine

        • Jasmine Lee

          Rules screenshot attached.

        • Jasmine Lee

          Attribute screenshot attached.

        • Jasmine Lee

          Label screenshot attached.

    • Eric Muiruir

      Hi Jasmine,

      I have followed all the steps as indicated in the screen shots you shared. However, i still keep getting the percentage as "Unknown"

      Let me share the screenshots from my end for your perusal.

       

      Regards

      Eric Kiruthi

    • Eric Muiruir
    • Eric Muiruir
    • Jasmine Lee

      From the screenshots, it looks like the concatenation rule doesn't have the conclusion style set. If so, this would certainly cause a problem.

      I'm going try uploading the example project again. That's probably the easiest way for you to see how it's meant to work. If the forum won't let me attach the project, I'll send you a private message so we can sort out another way for me to get the example to you.

      Cheers,
      Jasmine