Topic
  • 2 replies
  • Latest Post - ‏2013-01-07T16:53:04Z by SystemAdmin
bsandle
bsandle
20 Posts

Pinned topic How to calcuate "overall" status based on results of choice attributes

‏2013-01-04T19:35:04Z |
Is there a way to have focal point calculate an overall status by looking at the results of 10 choice attributes?

If any of the 10 choice attributes are status = red then overall status would automatically calculate to red. If they are all green then overall status is green. If they are all green but 1 is yellow, then overall status is yellow. etc..
Updated on 2013-01-07T16:53:04Z at 2013-01-07T16:53:04Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    269 Posts

    Re: How to calcuate "overall" status based on results of choice attributes

    ‏2013-01-07T16:51:21Z  
    Hi,

    I think you can probably get away with doing this in the following way.

    Create a supporting attribute which gathers all of the values from the 10 choice attributes.
    Lets call this SupportingAttribute1 with Default Value: ='choice1'+'choice2'+'choice3'+... ...+'choice10'
    This will give you values such as "RedGreenGreenRedYellowYellowGreenGreenRedYellow".

    You can now search within this string for the values "Red", "Yellow" and "Green" by creating another supporting attribute (SupportingAttribute2) and setting the default value to:
    =6*Match('SupportingAttribute1',".Red.*") + 3*Match('SupportingAttribute1',".Yellow.") + Match('SupportingAttribute1',".Green.")

    What this does is search the string and if it finds any reds it will add 6, any yellows it will add 3 and any greens it will add 1. You can now translate this numeric result into a status.

    If the value of SupportingAttribute2 is greater than or equal to 6 you know there is a red. If it's lower than 6 but higher than 1 you know there are yellows but no reds and if the value is 1 then you know that everything is green. You can create an indicator attribute which will report this as your overall status.

    Hopefully that all makes sense and will work. Let me know how it turns out.

    Ed
  • SystemAdmin
    SystemAdmin
    269 Posts

    Re: How to calcuate "overall" status based on results of choice attributes

    ‏2013-01-07T16:53:04Z  
    Hi,

    I think you can probably get away with doing this in the following way.

    Create a supporting attribute which gathers all of the values from the 10 choice attributes.
    Lets call this SupportingAttribute1 with Default Value: ='choice1'+'choice2'+'choice3'+... ...+'choice10'
    This will give you values such as "RedGreenGreenRedYellowYellowGreenGreenRedYellow".

    You can now search within this string for the values "Red", "Yellow" and "Green" by creating another supporting attribute (SupportingAttribute2) and setting the default value to:
    =6*Match('SupportingAttribute1',".Red.*") + 3*Match('SupportingAttribute1',".Yellow.") + Match('SupportingAttribute1',".Green.")

    What this does is search the string and if it finds any reds it will add 6, any yellows it will add 3 and any greens it will add 1. You can now translate this numeric result into a status.

    If the value of SupportingAttribute2 is greater than or equal to 6 you know there is a red. If it's lower than 6 but higher than 1 you know there are yellows but no reds and if the value is 1 then you know that everything is green. You can create an indicator attribute which will report this as your overall status.

    Hopefully that all makes sense and will work. Let me know how it turns out.

    Ed