Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Cross Tab Formula Post Reply Post New Topic
Author Message
pixie_1
Newbie
Newbie
Avatar

Joined: 02 Jul 2008
Location: Australia
Online Status: Offline
Posts: 5
Quote pixie_1 Replybullet Topic: Cross Tab Formula
     Posted: 02 Jul 2008 at 9:13pm
Hi
 
I have a crosstab which is as follows
 
01/01/2008      11/02/2008  26/05/2008
$1000               $2000           1500
 
I want to create a formula, If possible in a cross tab which will basically do this
 
1000 - 2000 = -1000
 
And do it for each day so for the next it would do
 
2000-1500 = 500
 
is this possible at all?
I basically just want to see the difference for each date from the previous day to see difference.
The crosstab only has 2 fields Date for the Column, and a count for the rows.
 
Thank you :)
IP IP Logged
venkatesha
Newbie
Newbie


Joined: 29 Jun 2008
Online Status: Offline
Posts: 35
Quote venkatesha Replybullet Posted: 03 Jul 2008 at 4:25am
If you are using Crystal Report 2008 its possible
Create Formula
    in that
       previous({DATASOURCE_txt.Amt})

In Crosstab
    Select Date for Column

    In Summarized field
       Select field to summarize
       also select the formula filed.

  Place the Cross Tab in the Report.
    In Display String of the Previous formula in the CrossTab
use the following formula

if not (CurrentColumnIndex=1) then
(
    totext(
    currentfieldvalue-
    gridvalueat(CurrentRowIndex,CurrentColumnIndex,CurrentSummaryIndex-1)
    )
)

I think it will be confusing, if required I can send u the sample we did
      


IP IP Logged
pixie_1
Newbie
Newbie
Avatar

Joined: 02 Jul 2008
Location: Australia
Online Status: Offline
Posts: 5
Quote pixie_1 Replybullet Posted: 03 Jul 2008 at 5:50pm
I would love it if you could send me the sample please :)
IP IP Logged
venkatesha
Newbie
Newbie


Joined: 29 Jun 2008
Online Status: Offline
Posts: 35
Quote venkatesha Replybullet Posted: 03 Jul 2008 at 10:44pm
Can I know which email address to send or can you make your email address public in the forum for some time.

Edited by venkatesha - 03 Jul 2008 at 10:47pm
IP IP Logged
pixie_1
Newbie
Newbie
Avatar

Joined: 02 Jul 2008
Location: Australia
Online Status: Offline
Posts: 5
Quote pixie_1 Replybullet Posted: 06 Jul 2008 at 3:00am
I'm ok posting it :)

franjones21@hotmail.co.uk

Thanks :)
IP IP Logged
pixie_1
Newbie
Newbie
Avatar

Joined: 02 Jul 2008
Location: Australia
Online Status: Offline
Posts: 5
Quote pixie_1 Replybullet Posted: 09 Jul 2008 at 11:07pm

Hi

Getting closer with this one.

i can see that you used the 'previous' but In my report I dont have any rows, just columns.

where I am stuck is that I am counting the number of transactions numbers and not actual values, so when it comes to using the 'previous' statement it for example does this

            01/01/2008      02/01/2008
Total:   1857                  2000
            1856                  1999

But how I want it to display is like this:

            01/01/2008      02/01/2008
Total:   1857                 2000
            0                       1857

Then if also possible

            01/01/2008      02/01/2008
Total:   1857                 2000
Prev     0                       1857
Diff       0                       143

Thanks
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