6 Replies Latest reply on Aug 30, 2018 11:54 PM by meenu choudhary Branched to a new discussion.

# Expected ''END" to match 'IF' at character 0

I am not able to fix this issue on the below table calculation:

IF [BESTCOMPANY]= 'H' THEN MAX([2015 Revenue])

ELSEIF [BESTCOMPANY]= "L" THEN MIN([2015 Expenses])

ELSE [BESTCOMPANY]= "T" THEN MAX([2015 Growth %])

END

H L T are parameters for High Revenue, Low Expenses and Top Growth respectively.

Can any one help me out why the error showing "Expected ''END" to match 'IF' at character 0" ?

Thanks you

• ###### 1. Re: Expected ''END" to match 'IF' at character 0

Sankar,

(2) ELSE [BESTCOMPANY]= "T" THEN MAX([2015 Growth %]) is wrong. It should be:

ELSEIF [BESTCOMPANY]= "T" THEN MAX([2015 Growth %])

Hope it helps.

Michael Ye

7 of 7 people found this helpful
• ###### 2. Re: Expected ''END" to match 'IF' at character 0

HI Sankar,

You are missing ïf"in the third line.

IF [BESTCOMPANY]= 'H' THEN MAX([2015 Revenue])

ELSEIF [BESTCOMPANY]= "L" THEN MIN([2015 Expenses])

ELSEIF [BESTCOMPANY]= "T" THEN MAX([2015 Growth %])

END

4 of 4 people found this helpful
• ###### 3. Re: Expected ''END" to match 'IF' at character 0

Sankar,

You can not give any condition with ELSE. Either use ELSEIF or just ELSE .

IF [BESTCOMPANY]= 'H' THEN MAX([2015 Revenue])

ELSEIF [BESTCOMPANY]= "L" THEN MIN([2015 Expenses])

ELSE  MAX([2015 Growth %])

END

OR

IF [BESTCOMPANY]= 'H' THEN MAX([2015 Revenue])

ELSEIF [BESTCOMPANY]= "L" THEN MIN([2015 Expenses])

ELSEIF [BESTCOMPANY]= "T" THEN MAX([2015 Growth %])

END

• ###### 4. Re: Expected ''END" to match 'IF' at character 0

Thank you Meenuji for your great support.

• ###### 5. Re: Expected ''END" to match 'IF' at character 0

Thank you Michael for your support.

• ###### 6. Re: Expected ''END" to match 'IF' at character 0

Hi Sankar,

If your query is resolved, please mark the solution as correct which helped you to solve your problem.