Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need CrossTab Formula Help Post Reply Post New Topic
Author Message
bucky7199
Newbie
Newbie
Avatar

Joined: 17 Feb 2008
Location: United States
Online Status: Offline
Posts: 30
Quote bucky7199 Replybullet Topic: Need CrossTab Formula Help
     Posted: 10 Mar 2008 at 9:48am
Can someone tell me if this is even possible?
 
I have a CrossTab report, with months across the top and expenses on the left side. How do I write a formula to suppress the row if the current month value of the expense is less than 2,000?
 
And if it is possible can you give me the formula. I am really struggling with this one. Please help!
 
Thanks, Ouch
Dan S.
IP IP Logged
themessenger
Groupie
Groupie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 48
Quote themessenger Replybullet Posted: 20 Aug 2008 at 1:44am
One way of doing it is by not using a cross-tab.  Create a formula for each month like:

frmJan08
=======
if month({Expenses.ExpenseDate}) = 1 and year({Expenses.ExpenseDate}) = 2008 then {Expenses.ExpenseValue} else 0

frmFeb08
=======
if month({Expenses.ExpenseDate}) = 2 and year({Expenses.ExpenseDate}) = 2008 then {Expenses.ExpenseValue} else 0

etc

Now set up a group of {Expenses.ExpenseType}

Create a summarising formula for the above functions:

frmTotJan08
=========
if SUM(@frmJan08,{Expenses.ExpenseType}) < 2000 then '' else ToText(SUM(@frmJan08,{Expenses.ExpenseType}))

frmTotFeb08
=========
if SUM(@frmFeb08,{Expenses.ExpenseType}) < 2000 then '' else ToText(SUM(@frmFeb08,{Expenses.ExpenseType}))

etc

Your group header should look something like:

{Expenses.ExpenseType}   {@frmTotJan08}  {@frmTotFeb08} etc

You should now suppress your detail section and the group footer and put the month headers above the columns.

Hope this helps.

theMessenger
Managing Director
www.allmymenus.com
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