Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Grouping Post Reply Post New Topic
<< Prev Page  of 2
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Sep 2010 at 10:41am
Create 2 RTs to get the 12 and 8 values then SUm those to RTS in a formula
name=Formula1 (or whatever you want)
field to summarize=CurrDed
Type=MAximum
Evaluate=Use a formula
MAXIMUM(PayEndDt,EmplId)=PayENdDt and DedType=2
Reset=Group level 2 (EmplID)
 
name=Formula2 (or whatever you want)
field to summarize=CurrDed
Type=MAximum
Evaluate=Use a formula
MAXIMUM(PayEndDt,EmplId)=PayENdDt and DedType=1
Reset=Group level 2 (EmplID)
 
Formula field is {#Formula1} + {#Formula2}
Place on group footer 2
IP IP Logged
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Posted: 24 Sep 2010 at 6:52am
Hi,
 
this works when the employee has both Type 1 and Type 2 deductions, but if there is only 1 particular ded per ded code/employee, I seem to lose the amount and it shows as nothing.
ie.

EmplId   Ded Cd  PayEnd Dt    EmplyeContr  EmplyrContr  Curr Ded DedType

1000      S100      2010/09/09    0.0                25.00            10.00    2

1000      S100      2010/10/09    0.0                15.00            12.00    2

1000      S100      2010/09/09    15.00             0.0               10.00    1

1000      S100      2010/10/09    10.00             0.0                  8.00    1
The above works, curr ded shows as 20.00 in Group2 footer
 
1010      S100      2010/09/09    15.00             0.0               10.00    1

1010      S100      2010/09/15    15.00             0.0               10.00    1

1010      S100      2010/10/09    15.00             0.0               10.00    1

The above doesn't work, curr ded shows as nothing istead of 10.00
 
I created RTs for Type 1 and Type 2 curr ded and on the Formula field I put
 
If {#EE_Curr_Ded} > 0 And
   {#ER_Curr_Ded} > 0 Then
{#EE_Curr_Ded} + {#ER_Curr_Ded}
Else
 If {#EE_Curr_Ded} > 0 Then
    {#EE_Curr_Ded} Else
   If {#ER_Curr_Ded} > 0 Then
     {#ER_Curr_Ded}
 
I am still getting nothing in Group2. I want to see 10.00, it still works when the empl has both 1 and 2 type.
 
When I display the #EE_Curr_Ded and #ER_Curr_Ded in Group2 footer, it displays 10.00 in #EE_Curr_Ded. Why is the formula not working ?
  
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Sep 2010 at 8:15am
in your formula that adds EE and ER change the pick list setting about how to handle NULLS to 'Use defaalt values'
formulas often 'die' on null values unless you do not tell it what to do when it hits or if you change it to defualt values
since sometimes you have ne EE or ER this would be a NULL


Edited by DBlank - 24 Sep 2010 at 8:21am
IP IP Logged
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Posted: 24 Sep 2010 at 9:08am
Sorry, I don't know where to find it. Is it somewhere in the Formula Editor ?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Sep 2010 at 9:55am

when you open up a formula to edit it, mine is in the upper right hand corner but that is configurable. it is a pick list with 2 options in it.

IP IP Logged
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Posted: 24 Sep 2010 at 10:39am
I am on version 9. Is it possible that it's somewhere else ? Is it some kind of a tab called pick list ? I am using Crystal Syntax or does it matter ?
The only thing I see is under File>Options - under When reading data, check box for either Convert Database NULL Values to Default or Convert Other NULL Values to Default.
 
There is also under File>Report Options>General Settings - check box for Convert Database NULL Values to Default and another one for Convert Other NULL Values to Default.
 
Thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Sep 2010 at 11:50am
it is hidden in there somewhere but you can try this instead.
(if isnull({#EE_Curr_Ded}) then 0 else {#EE_Curr_Ded})
+
(if isnull({#ER_Curr_Ded}) then 0 else {#ER_Curr_Ded})
 
IP IP Logged
Zuzanna
Groupie
Groupie


Joined: 10 Sep 2010
Location: Canada
Online Status: Offline
Posts: 56
Quote Zuzanna Replybullet Posted: 27 Sep 2010 at 5:48am
It worked. Many thanks.
IP IP Logged
<< Prev Page  of 2
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.000 seconds.