cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Hana handling Distinct Count on a Formula

Former Member
0 Kudos

hana-distinct-counter-error.jpghana-distinct-counter-error.jpg

Hi Experts,

Here is my requirement.

I have two columns "Shipment_number" and "Shipment_Reason" in table.

- Create Calculation View1 for below 3 points.

1. Need to create Distinct Counter on "Shipment_number" which I have done to get the unique count of "Total Shipments Count".

2. Need to create the calculated column "Late Shipments" filtering the "shipment Reason" != 'ON TIME' which I have done.

3. Need to create the Distinct counter on calculated column "Late Shipments" which is unique count of late shipments "Late Shipments Count". This also I have done.

- Created Calculation view2 consuming Calculation View1 to create

"Late Shipments Percentage" for 4th Point.

Issue is on below 4th Point:

4. Now I want to create the calculated column "Late Shipments Percentage" using both the counter calculated columns using below formula

"Late Shipment Count" / "Total Shipments Count".

Now I executed the Data Preview of Calculation View2 and in Analysis tab dropped the Year and Plant dimensions, then dragged and dropped "Late Shipment Count" column and I am getting the error as "Error SAP DBTech JDBC: [2048]: column store error: [34023] Instantiation of calculation model failed;exception 306103: Count distinct on formula is not allowed on any other node except than top aggregation node '$ARG3$' ".

kindly Check and provide your inputs.

Thanks in Advance,

Parasuram

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member439824
Contributor
0 Kudos

Hi,

I realize the thread is old, but I had exactly the same problem today and could not find an answer online.

The problem is actually in your Calculation View1.

You have to create your Counter "Total Shipments Count" and "Late Shipments" in a node below the top node(a projection).

Then, in the top node you can create the distinct counter "Late Shipments Count", while making sure that aggregation is NOT enabled for the "Late Shipments" .

If you enable aggregation for "Late Shipments" in Calculation View1, you will get this error in view 2 ==> "Error SAP DBTech JDBC: [2048]: column store error: [34023] Instantiation of calculation model failed;exception 306103: Count distinct on formula is not allowed on any other node except than top aggregation node '$ARG3$' ".

Max