2 Replies Latest reply on Jul 3, 2013 12:32 AM by adhutchinson

    Case Function Issue

    adhutchinson

      Title

      Case Function Issue

      Post

           I'm building a Sports League Manager, and I've struck a bit of a problem with calculating how many Matches are required for the different types of Leagues Available (Round Robin, Knockout, Double Elimination)

           Using a Case Funtion, I have the calculation working fine for Round Robin.

           Now I need to add in the Knockout and Double Elimination Calculations, but when I attempt it it tells me I havent entered enough operators.

           Here's my Calulation... No doubt I'm missing something simple, sometimes a different set of eyes can work wonders.

            

            

           Case (
           Fixture_Type = "Round Robin"; (If ( Mod ( Team_Number ; 2 ) ; (((( Team_Number + 1 ) * Team_Number ) * Fixture_Cycles) / 2) ; (((( Team_Number - 1 ) * Team_Number ) * Fixture_Cycles) / 2)))) ; <--This is where it goes wrong for me
           Fixture_Type = "Knockout" ; (Team_Number - 1) ;
           Fixture_Type = "Double Elimination" ; ((2 * Team_Number) - 2)
           )

            

           All help much appreciated

            

        • 1. Re: Case Function Issue
          jmw

                

               Adam,

               slightly reformatting the statement seems to indicate that there is an extra ')'  (indicated in red):

                

               Case (

               Fixture_Type = "Round Robin";

               (  

               If ( Mod ( Team_Number ; 2 ) ; 

               (((( Team_Number + 1 ) * Team_Number ) * Fixture_Cycles) / 2) ; 

               (((( Team_Number - 1 ) * Team_Number ) * Fixture_Cycles) / 2) )

               )

                ) ; <--This is where it goes wrong for me

                

               Fixture_Type = "Knockout" ; (Team_Number - 1) ;

                

               Fixture_Type = "Double Elimination" ; ((2 * Team_Number) - 2)

               )

                

                

          • 2. Re: Case Function Issue
            adhutchinson

                 Jan,

                 Fantastic... Thank you for your help.

                  

                 As I said, having a fresh set of eyes look at it would probably reveal a very simple error.

                  

                 Works a Charm Now smiley