Conditional Formulas in Cross Tab - Crystal Report (Sumif Function)

Jun 07, 2017 at 08:36 PM


avatar image
Former Member

Hello. I am searching for something like conditional formula in Crystal Reports ( like SUMIFS ) in a cross tab , wherein i need to calculate the sum of a column B field where the condition is – Condition 1:- if the data in "Column C" and " Column D" is 0 then it should not add/sum the values in column A and exclude the values while summing up the column A. Condition 2:- (Column A is Date Column) there should be criteria for bifurcating the summed data on the basis of 2 different dates. For example on 27-May-2017 the operating cost should come as 240000 and on 28-May-2017 the operating cost should come as 735000. This is more like pivot data in excel but with a certain conditions. I am sorry if did not make myself clear in the above question or if I wrote anything that is ambiguous.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Brian Dong Jun 07, 2017 at 11:14 PM

Hi Deepak,

You can create a formula like:

If {table.COLUMNC} = 0 And {table.COLUMND} = 0 Then 
    Date (0, 0, 0) 
Else {table.COLUMNA}; 

The Date (0, 0, 0) is a NULL date so it should not be included in your Sum. It may be included if you are doing a count though.

I'm not sure how you would do your second condition though. Is your columns based on ColumnA because that would make your second condition difficult.



10 |10000 characters needed characters left characters exceeded
Skip to Content