4 Replies Latest reply on Nov 17, 2016 2:05 PM by Rekha Kesavan

# Help with MAX(IIF) Calculation

Please can someone tell me what i'm doing wrong with this calculation?

MAX(IIF([Primary Member Type Description] = "Basic", 1,0) ELSEIF ([Line Status Code] = "C", 1,0))=1

The first argument ("Basic") works: MAX(IIF([Primary Member Type Description] = "Basic", 1,0))=1

but i'm trying to add a new argument "status code" and get this message "Expected closing parenthesis or comma while parsing argument list for MAX.

Thank you.

• ###### 1. Re: Help with MAX(IIF) Calculation

Hello Paul,

Where does ELSIF come from?

MAX(IIF([Primary Member Type Description] = "Basic", 1,0),IIF([Line Status Code] = "C", 1,0))=1

Regards

• ###### 2. Re: Help with MAX(IIF) Calculation

That did not work.

I'm trying to create a calculated/dynamic set of customer ids for my basic members. This way i won't have to create one each month to see if my basic members upgraded or lapsed to a lesser category. The calculation is done my customer id dimension and my numbers are higher than what they should be per month.

• ###### 3. Re: Help with MAX(IIF) Calculation

The formula doesn't look right, don't think you can have the ELSEIF nested between IIF statements.

Try:

MAX(IF [Primary Member Type Description] = "Basic" THEN 1 ELSEIF [Line Status Code] = "C" THEN 1 ELSE 0 END)=1

Not sure that'll give you the results you expect but the syntax should be ok.

• ###### 4. Re: Help with MAX(IIF) Calculation

Hi Paul,

We cant use Else if without IF statement. But if you looking for nested IIF, then below should work. Logically, if the first IIF statement turns fall, the next IIF statement will be executed.

MAX(IIF([Primary Member Type Description] = "Basic",1,IIF([Line Status Code] = "C",1,0)))=1

Thanks

Rekha