Scoring Category Fields

Comments

4 comments

  • Rainer Grabowski

    Hi Jim,

    it works this way for each category field:

    var field = @OutScore;
    var option1 = "Lagger";
    var option2 = "Leader";
    field == option1 ? 0 : field == option2 ? 1 : null

    If a score field has more than 2 options:

    var field = @XYZScore;
    var option1 = "A";
    var option2 = "B";
    var option3 = "C";
    var option4 = "D";
    field == option1 ? 0 : field == option2 ? 1 :  field == option3 ? 2 :  field == option4 ? 3 : null

    Read it as: IF equal to (==) THEN (?) ELSE (:). You must always end it with an ELSE; null means - show nothing
    I use the version with vars (= variables) cause that you can copy and paste into each score calculation field, you need to change the values (like "A", "B" etc) only (and the value for var field)

    To add up all the scores simply add the calculation fields 
    @OutScoreCalculation +  @BackScoreCalculation + @GaitScoreCalculation

    Hope that helps you for your very important job!
    Greetings from an owner of 2 dogs to the dog trainer. 
     
    Rainer

     

    0
    Comment actions Permalink
  • Joel Ordesky

    Ok my dog is a bit rusty but here you go.

    Bark ruff snuffle woof sniff tail wag grrr yip. Head shake woof ruff roll over yip. Cover head with paws jump up woof grrr sniff bark. 

    For those not fluent in dog or in case I made a mess of that translation:

    Make a calculation field that looks like this. 

    @field_name == "Leader" ? 1 : 0 

     

     

    If you had more options then just the two than it would take something a bit more complicated. 

    0
    Comment actions Permalink
  • Joel Ordesky

    BTW on your second question you for it right. 

    Make a calculation field Total Numeric Score that would be: @OutScore + @BackScore + @GaitScore

    Remember you can't use a new created calculation field in a subsequent calculation field until you have saved one time. 

    0
    Comment actions Permalink
  • Jim Cantrell

    Thank you gents!  I'll try these suggestions out.

    And Angus here says thank you as well!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk