Author |
Message |
BoltzGirl
Groupie
Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
|
Topic: Formula Help with Parens Posted: 07 Aug 2017 at 11:12am |
I am working on this formula and need some help.
If {AUTHS.ReferralType} = "DIA" and isnull ({V_SupplementalDataEndServiceDate.EndServiceDate})
else
If {AUTHS.ReferralType} like ["LTC", "PAL","HPC"] and isnull ({AUTHS.DischargeDate})
else isnull({Members.MBRNO}) and {AUTHS.ExpirationDate} > {@StartDefaultDate}
or not isnull({Members.TermDate})
I continue to get "The Keyword 'then' is missing" erro and it's highlighting the first "else" in line 3 above.
Extra eyes would be of great help and TIA.
|
IP Logged |
|
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
|
Posted: 07 Aug 2017 at 12:03pm |
I am assuming that you are using Crystal format. First off, you will need a THEN after your condition on each of the IF statements. Also it is a little odd not to have something for the THEN, but just have a statement for the ELSE. And your last ELSE looks like another conditional, but it is not preceded by an I.
|
IP Logged |
|
BoltzGirl
Groupie
Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
|
Posted: 07 Aug 2017 at 12:11pm |
Sorry, I am using SAP Crystal Reports, 2013 Support Pack 7, version 14.1.7.1853 and changed the formula to include my then on each line, but now it is saying "Boolean is Required" and highlights the entire last section of my formula below where my IF starts.
{Members.CGRPID} like {?Health Plan} and
{Members.CIPACD} like {?IPA} and
{Members.CPLNTP} like {?LOB} and
If ({AUTHS.ReferralType}) = "DIA" and isnull ({V_SupplementalDataEndServiceDate.EndServiceDate})
then 'DIA'
else
If ({AUTHS.ReferralType}) like ["LTC", "PAL","HPC"] and isnull ({AUTHS.DischargeDate})
then 'LTC'
else
If isnull({Members.MBRNO}) and {AUTHS.ExpirationDate} > {@StartDefaultDate}
or not isnull({Members.TermDate})
then 'MBR'
|
IP Logged |
|
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
|
Posted: 08 Aug 2017 at 4:08am |
Looks like you are doing the formula in the select expert (used for filtering). Thus it wants a true/false result from the formula.
Not sure what you are trying to accomplish with this formula other to display a value based on some conditions.
|
IP Logged |
|
BoltzGirl
Groupie
Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
|
Posted: 08 Aug 2017 at 4:51am |
Yes, that is where I have it. Your comment just made me think and realize what I am doing wrong. LOL thank you! I need to create a couple of formulas for these specific records I am looking for, then use my formulas in my selection criteria. Did that and now it's working :-)
|
IP Logged |
|
|