Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crystal Sum with two conditions

I am trying to get summary by two conditions, much like Sumifs function of excel Like - Sum(Total_Costs) where Region = 4 and Currency = USD. Thanks in advance

like image 711
user455580 Avatar asked Dec 02 '10 17:12

user455580


2 Answers

You will have to create a Formula called @Region4USD

Something like

if ({YourReport.Region} = 4 and {YourReport.Curency} = "USD") then
    {YourReport.Total_Cost}
else
    0

Then create a SUM on the formula

like image 134
Adriaan Stander Avatar answered Nov 26 '22 06:11

Adriaan Stander


You can create a running total. That way, you have the option of using the "Evaluate" section to use your own conditions when you click on the "Use formula" option.

like image 33
Mark SQLDev Avatar answered Nov 26 '22 07:11

Mark SQLDev