Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Running Balance for UNION report

Received Response
12
Views
3
Comments
Avinash Pentyala
Avinash Pentyala Rank 5 - Community Champion

Dears,

I have a requirement to calculate running balances based on the open balance for UNION report.

The first UNION report is displaying the open balance and the second union is displaying transaction details, below is the sample format

Kindly advise how can I derive the running balance?

pastedImage_0.png

I really appreciate your help.

Answers

  • Jerry Casey
    Jerry Casey Rank 6 - Analytics Lead

    Are you familiar with the "Add Result Column" link on the combined analysis window? It allows you to create columns calculated outside the union.
    If your union looks like your example table, I would add a result column that looks like MAX(saw_1)+RSUM(ifnull(saw_2,0)).

  • Avinash Pentyala
    Avinash Pentyala Rank 5 - Community Champion

    Yes, I've tried this option getting group by error.

    NQS Error 59111 - The SQL statement must include group by clause.in Advanced tab, group by clause is available but that is enable for UNION report.

    is there any way for this??

  • Jerry Casey
    Jerry Casey Rank 6 - Analytics Lead

    Try adding  "by 1" to the Max clause:  MAX(saw_1 by 1)+RSUM(ifnull(saw_2,0)). I know it's a workaround, but the addition of a constant eliminates that error in most cases.