Skip to Content
0

Crystal Parameter to only apply to Company A

Feb 27 at 04:38 PM

37

avatar image

Experts,

I have a Crystal Report Income statement that pulls from a SQL View. This View is pulling data from 2 DB's.

I have a Date Range parameter that applies to both DB's (CompanyA and CompanyB), but a Cost Center Parameter (Operations) that should apply only to CompanyA.

How will I go about writing this formula? What I have currently is not pulling Company B, because there is no Cost Centers created there.

{yIncomeStatementUnion.RefDate} = {?DateRange} and
{yIncomeStatementUnion.OcrName} = {?Operation}
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Ian Waterman Feb 27 at 04:59 PM
1

Try

{yIncomeStatementUnion.RefDate}={?DateRange}

OR

({yIncomeStatementUnion.OcrName}={?Operation} and

{yIncomeStatementUnion.RefDate}={?DateRange}

)

Ian

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Ian,

Thanks for your reply.

When I copied that to the Formula editor, it did not limit CompanyA's data to only the selected Cost Center.

Your input will be appreciated,

Marli

0

Sorry misunderstood, not familiar with your data structure, this might work.

({yIncomeStatementUnion.OcrName}<>{?Operation} and

{yIncomeStatementUnion.RefDate}={?DateRange}

)

OR

({yIncomeStatementUnion.OcrName}={?Operation} and

{yIncomeStatementUnion.RefDate}={?DateRange}

)

1

Ian,

Thanks for your assistance, however this is showing both Companies, but not the correct values in CompanyA. Shows full amounts, not the selected cost center values.

Marli

0

Assuming you can not change view I think you will have to explicitly identify the companies

({yIncomeStatementUnion.CompanyName} = 'CompanyB' and

{yIncomeStatementUnion.RefDate}={?DateRange}

)

OR

({yIncomeStatementUnion.CompanyName} = 'CompanyA' and

{yIncomeStatementUnion.OcrName}={?Operation} and

{yIncomeStatementUnion.RefDate}={?DateRange}

)

Obviously change this to appropriate field and name or ID

Ian

1
Marli Schutte Mar 05 at 04:14 PM
0

Ian,

This also did not work as expected and I then changed the View to hardcode the WHERE statement in.

Thanks for your help!

Marli

Share
10 |10000 characters needed characters left characters exceeded