cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Parameter to only apply to Company A

former_member268870
Participant
0 Kudos

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}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member

Try

{yIncomeStatementUnion.RefDate}={?DateRange}

OR

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

{yIncomeStatementUnion.RefDate}={?DateRange}

)

Ian

former_member268870
Participant
0 Kudos

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

Former Member

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}

)

former_member268870
Participant
0 Kudos

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

Former Member

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

former_member268870
Participant
0 Kudos

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