Skip to main content

Hi,

 

I want to add a column to an OLAP table that shows whether all orders from a given supplier exceed the value of 100 or not. So the final table should show a supplier name, the number of orders, the net worth of orders and either:

 

  1. The net worth value sum if its above 100, else 0
  2. An 'x' when the sum of orders exceeds 100

 

Also, it would be great to see how many single orders exceeded the value of 100.

 

I was trying around for a while with PULL functions and CASE WHEN but I can't seem to make it work with the restriction of '> 100'. For example the query below gives me an error message stating that CASE is not compatible with FLOAT and INT.

 

SUM(

CASE WHEN "EKPO"."NETWR_CONVERTED" > 100

THEN "EKPO"."NETWR_CONVERTED"

ELSE 0

END)

 

Thank you very much in advance.

 

Best regards

Aram

Hi Aram,

 

Your code is logically correct! The issue arises in the FLOAT vs INT type issue. It seems that the "EKPO"."NETWR_CONVERTED" column is of type FLOAT yet your ELSE case is of type INT. If you change the `0` to a `0.0` the typing issue will be resolved.

 

Hope this helps!


Reply