Skip to Content

Add database field after summarized column in Cross Tab Crystal reports

Hi!

How do i place the Balance column after the 3 - March column?

My desired output is:

Thanks!

Ritchie

cr-sample.png (34.6 kB)
cr-sample-2.png (34.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 02 at 07:40 AM

    Hi Ritchie,

    I assume "Balance" is a precalculated field already measured at the "CardCode" level?

    And I believe this is a Crosstab?

    Here's what you need to do:

    1. Create a formula with this code:

    {CarCode} & ">" & {Balance}

    2. Go to the Crosstab Expert and replace the existing row field with this formula field.

    3. Right-click the "3-March" header cell > Calculated Member > Insert Column. A blank column is inserted to the end of the Crosstab.

    4. Right-click the blank header cell > Calculated Member > Edit Insertion Formula > use this code and save the formula:

    GetColumnGroupIndexOf(CurrentColumnIndex) = 0

    5. Right-click the blank header cell > Calculated Member > Edit Header Formula > use this code and save the formula:

    "Balance"

    6. Right-click one of the blank summary cells in this new column > Calculated member > Edit Calculation Formula > use this code:

    tonumber(split(GridLabelAt("@Formulafield", CurrentRowIndex),">")[2])

    Note: Replace "Formulafield" above with the name of the formula you created in Step 1. It needs to be enclosed in double quotes exactly like above.

    7. Right-click one of the cells in the Row field > Format Field > Common tab > Click the formula button beside "Display String" and use this code:

    split(currentfieldvalue, ">")[1]

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded