Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: If then or? Post Reply Post New Topic
Author Message
Jeanette
Newbie
Newbie
Avatar

Joined: 26 Feb 2008
Location: United States
Online Status: Offline
Posts: 8
Quote Jeanette Replybullet Topic: If then or?
     Posted: 29 Feb 2008 at 1:08pm
Hello again...
Still learning but pleased w/progress after 3 days of self teaching!!
 
I have report with following two fields - Item # and Qty Ordered.  I want to multiply the Qty order by $3.90 if the item # is XX or XX or XX or XX.  The Item # is a string field.
 
Thanks.  And, FYI, you all are a great resource!!
 
Jeanette
Jeanette B
IP IP Logged
fusion
Groupie
Groupie


Joined: 12 Nov 2007
Location: United States
Online Status: Offline
Posts: 93
Quote fusion Replybullet Posted: 29 Feb 2008 at 1:38pm
If Item# in ['xx','xx','xx'] then Qty Order * 3.90
Else 0

You have might have to customize based on your requirement. Hope this helps
IP IP Logged
Jeanette
Newbie
Newbie
Avatar

Joined: 26 Feb 2008
Location: United States
Online Status: Offline
Posts: 8
Quote Jeanette Replybullet Posted: 03 Mar 2008 at 1:08pm
One more twist.  If the item # isn't one of the numbers in the first group but in a second group then the qty ordered must be multiplied by 2.45.
 
Something like --
 
If {item#} in ('00810''00511''00319''00612') then {qty ordered} * 3.9 or if in ('60003''80005''80010') then {qty ordered} * 2.45
 
It won't let me put two formulas in the detail section -- I wrote a second formula and tried to put it in section also but ignored it???  Obviously, not a mind reader!!
 
Can you help me with this one also?
 
Thanks.
Jeanette
Jeanette B
IP IP Logged
fusion
Groupie
Groupie


Joined: 12 Nov 2007
Location: United States
Online Status: Offline
Posts: 93
Quote fusion Replybullet Posted: 03 Mar 2008 at 1:26pm
If {item#} in ('00810''00511''00319''00612') then {qty ordered} * 3.9
if  {item#} in ('60003''80005''80010') then {qty ordered} * 2.45
else {qty ordered}
 
Hope this helps if I understood your problem correctly
IP IP Logged
Jeanette
Newbie
Newbie
Avatar

Joined: 26 Feb 2008
Location: United States
Online Status: Offline
Posts: 8
Quote Jeanette Replybullet Posted: 03 Mar 2008 at 1:57pm
If {OEORDLIN_SQL.item_no} in ('00810''00811''00812''00815''00813''00814''00915-TS') then ({OEORDLIN_SQL.qty_ordered} * 3.9) if {OEORDLIN_SQL.item_no} in ('60006') then {OEORDLIN_SQL.qty_ordered} *.366 else 0
 
Above is the formula as entered.  When I check the formula it highlights what I show highlighted and says "The remaining text does not appear to be part of the formula" and will not accept it.
 
Thank you so much for your help!
 
Jeanette
Jeanette B
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 04 Mar 2008 at 7:28am
Hi Jeanette,
 
Change to below
 
If {OEORDLIN_SQL.item_no} in ('00810''00811''00812''00815''00813''00814''00915-TS') then
({OEORDLIN_SQL.qty_ordered} * 3.9)
 
else if {OEORDLIN_SQL.item_no} in ('60006') then
{OEORDLIN_SQL.qty_ordered} *.366
 
else 0
 
Cheers
Rahul
IP IP Logged
fusion
Groupie
Groupie


Joined: 12 Nov 2007
Location: United States
Online Status: Offline
Posts: 93
Quote fusion Replybullet Posted: 04 Mar 2008 at 1:13pm
Thanks Rahul for the correction. This should solve Jeanette's Problem
IP IP Logged
Jeanette
Newbie
Newbie
Avatar

Joined: 26 Feb 2008
Location: United States
Online Status: Offline
Posts: 8
Quote Jeanette Replybullet Posted: 04 Mar 2008 at 2:36pm
Thanks to you all for the wonderful help!  My office now thinks I am a genius since others have gone to classes and haven't been able to accomplish what I have!
 
That formula has been used several times today since everything we do is based upon which product is being sold.
 
I am a new employee and found that people were manually creating spreadsheet reports and forms (which in effect was creating a second set of records) and not pulling info from the system.  My goal has been to get everyone to work with our system not outside of it.
 
You all are great!  Thanks so much!
 
Jeanette
Jeanette B
IP IP Logged
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