Skip to Content
0
Former Member
Apr 30, 2014 at 03:02 PM

Conditional Sum - This Year compared to same Period Last Year

29 Views

Hello all,

I am having a bit of a problem that's so easy to get with excel but I'm having a hard time in Crystal.

I am trying to re-create a layout as below in crystal reports. I am importing both Jan-14 and Jan-13 into the report via SQL Commands as the source. I have tried Formulas below but they do not give me a breakdown by month. Can someone please guide me where I went wrong? The formulas give me the total for the 2 months and not broken down by their respective months.

dim TotalAmt as number

if {Command.MONTH} = {?EndDate} then

TotalAmt = Sum ({Command.Pax}, {Command.FLIGHT#})+TotalAmt

formula = TotalAmt

else

formula=0

end if

Attachments

Untitled.png (1.4 kB)