on 05-29-2017 12:22 PM
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???
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.