Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Nesting If/Then Statements Post Reply Post New Topic
Author Message
ClantonC
Newbie
Newbie
Avatar

Joined: 08 Feb 2014
Online Status: Offline
Posts: 19
Quote ClantonC Replybullet Topic: Nesting If/Then Statements
     Posted: 25 Feb 2014 at 7:57am

I know I ask far more than I can return so thank you all for your help.

I have a formula ({Table.A} – {Table.B})/{table.B} to find the percentage of increase or decrease between these two tables. The problem in Table.B has instances where the value is “0”. This still may result in an increased value so I don’t want do a simple If/Then to force a “0”.

I tried this formula but received an error. I’m sure it’s because I am not nesting right.

 

If {UCR_Code__1.2014 YTD} and {UCR_Code__1.2013PYTD} = 0 then

"0"

If {UCR_Code__1.2013PYTD}= 0 then

{UCR_Code__1.2014 YTD} * 100,

Else ({UCR_Code__1.2014 YTD} – {UCR_Code__1.2013PYTD})/{UCR_Code__1.2013PYTD}

IP IP Logged
hello
Groupie
Groupie
Avatar

Joined: 05 Feb 2014
Online Status: Offline
Posts: 85
Quote hello Replybullet Posted: 25 Feb 2014 at 9:31am
My guess:

If   {UCR_Code_1.2014YTD} <> 0
Then
        If   {UCR_Code_1.2013PYTD} <> 0
        Then ({UCR_Code_1.2014YTD} –
             {UCR_Code_1.2013PYTD})/
             {UCR_Code_1.2013PYTD}
        Else
             {UCR_Code_1.2014YTD} * 100
Else
     {UCR_Code_1.2014YTD} * 1
                          

Edited by hello - 25 Feb 2014 at 11:01am
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