cancel
Showing results for 
Search instead for 
Did you mean: 

Can we use Calculated Columns in Aggregation node

Former Member
0 Kudos

Hello Experts,

I am trying to do some calculation ( counts and sum of amount)

For counts i have created a few calculated columns like below

if ( in("TYPE", 'Machines' , 'Miscellaneous' , 'Parts' , 'Past Due Charge'),1,0)

defined as integers.

And when i am trying to sum up the counts its always give me 1, where as the other values like amounts gets summed up.

Basically the source is an another CA view (type Cube). I have 2 rows coming from view whose total sum of amount equals the amount from my view,

whereas the count is always 1.

Below is the current SQL from HANA Scripted CA view, I am converting this to a Graphical one

select partner,

DUE_DATE ,

COMP_CODE,

COUNT(CASE WHEN TYPE = 'Machines' OR TYPE = 'Miscellaneous' OR TYPE = 'Parts' OR TYPE = 'Past Due Charge' THEN TYPE END) AS "COUNT",

SUM(AMT_OWED ) AS "AMOUNT"

from table

group by

partner, DUE_DATE , COMP_CODE

Any thouhts???

Accepted Solutions (0)

Answers (0)