How to add your knowledge

Computed Fields: Small but Powerful

    Take a look at some examples of computed fields demonstrating the range and flexibility of this powerful feature.

    Text

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/comp_field1.png

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/comp_field2.png

    Advanced text:

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic3.png

    Text with a link:

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic4.pngMath

    Next up – math!  I’m sure you’ll quickly see how this can be very useful, especially if your current processes rely on Excel. 

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic5.png

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic6.png

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic7.png

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic8.png

    This can be extended to use more complex calculations.

    Conditions/Testing

    We can use computed fields for conditioning logic as well.

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic9.png

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic10.png

     

    -- tests the input value against the value of 50
    CASE
    WHEN (CAST(TEST_VALUE as FLOAT) > 50)
      THEN 'The test value is greater than 50'
    WHEN (CAST(TEST_VALUE as FLOAT) < 50)
      THEN 'The test value is less than 50'
    WHEN (CAST(TEST_VALUE as FLOAT) = 50)
      THEN 'The test value is equal to 50'
    ELSE
       'Value cannot be compared to 50'
    END

    Mashups

    This next example shows a slick way to embed a Google map from the address information provided.

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic12.png

     

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic13.png

    File:PLM_360/enu/Community/Tips_&_Tricks/Computed_Fields/pic14.png

    '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;...p;hl=en&amp;q=' + STREET + ',' + CITY + ',' + COUNTRY + ';t=h&amp;z=14&amp;output=embed"></iframe>'

    For more help on creating mashups with Google services, see Google Code Playground (code.google.com/apis/ajax/playground).