Skip to Content

Crystal Parameter to only apply to Company A

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}
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 27 at 04:59 PM

    Try

    {yIncomeStatementUnion.RefDate}={?DateRange}

    OR

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

    {yIncomeStatementUnion.RefDate}={?DateRange}

    )

    Ian

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Mar 05 at 04:14 PM

    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

    Add comment
    10|10000 characters needed characters exceeded