Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Help with Parens Post Reply Post New Topic
Author Message
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet 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 IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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 IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet 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 IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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 IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet 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 IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.029 seconds.