Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 302

# Multiple filter in Crystal Report

I have a table specified like the following:
Column Name          Data Type
K                    Number
V                    Number
I want to use Crystal Report to report results below:
- A field which contains Sum of V where K is in 1 to 2.
- A field which contains Sum of V where K is in 3 to 4.
What should I do?
Can anyone help me?
0
rock2003
• 2
• 2
1 Solution

Commented:
Use a running total.

Open the report
Create a new running total
Give the running total a name - V_Sum12
Field to summarize - V
Type of summary - SUM
Evaluate - Use a formula - K >= 1 and K <= 2
Reset - Never

Do a similar formula for the other case

mlmcc

0

Commented:
Create two formula fiedls. FORK12 and FORk34

if k = 1 or k = 2 then
v
else
0
if k = 3 or k = 4 then
v
else
0
Place these in the details sections as two fields.

You can then insert the sum for these fields in the Group Footer / Grand Total.

Srini
0

Author Commented:
Hi, mlmcc!
Suppose that data of the table were:
(K, V) = {(1,1), (2,2), (3,3), (4,4)}
I create 2 running total field as you suggest. Then I put them into the Report Header section (not the Details section).
When I preview the report, it shows wrong results like the following:
V_Sum12: 1
V_Sum34: null
Can you help me shoot this problem?
Thanks.
0

Author Commented:
0

Commented:
The running totals get calculated as the report runs.  Putting them in the header only accounts for the first record.  Totals were correct.

Try putting them in the report footer.

mlmcc
0

## Featured Post

• 2
• 2
Tackle projects and never again get stuck behind a technical roadblock.