Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Nested Iff statement Post Reply Post New Topic
Author Message
mardiana
Newbie
Newbie


Joined: 14 Sep 2008
Location: United States
Online Status: Offline
Posts: 1
Quote mardiana Replybullet Topic: Nested Iff statement
    Posted: 14 Sep 2008 at 9:27am

I'm having a hard time getting a nested IFF statement to work.  I have 6 variables for each record.  In a 7th cell, I'm trying to build a formula that will scan the 6 variables and determine if they contain 3 required values and report 'OK' if so, or 'Problem' if not.  Summing 'successes' needs to be >= 3. 

Example:  The values required for 'OK' are 20, 30, 40.  If all three values are not found, there is a problem.
 
Var 1   Var2   Var3   Var4   Var5   Var6   Result
  10      20       25      30      35       40     OK
  10      15       20      30      35       38      Problem
 
Any assistance you could provide would be appreciated!  Tongue


Edited by mardiana - 14 Sep 2008 at 9:40am
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 14 Sep 2008 at 10:15pm

you can write the IFF statement as below.

if {var1} = 20 or {var2} = 20 or {var3} = 20 or {var4} = 20 or {var5} = 20 or {var6} = 20 then
   (
     if {var1} = 30 or {var2} = 30 or {var3} = 30 or {var4} = 30 or {var5} = 30 or {var6} = 30 then
         (
             if {var1} = 40 or {var2} = 40 or {var3} = 40 or {var4} = 40 or {var5} = 40 or {var6} = 40 then
                ("OK")
            else
                ("PROBLEM";)
   
         )
    else
         ("PROBLEM";)
   )
else
   ("PROBLEM";)
Thanks
Savan
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.015 seconds.