Skip to main content

We have a problem where we are using a case when statement to derive columns with aggregated buckets.

When we try and group the buckets into case numbers, it groups the entire count of case numbers into a single bucket. Rather than splitting the data into multiple different buckets.

CODE USED------------------

CASE WHEN

SUM ( 

CASE  WHEN "TABLE"."ABC"='A'

AND ACTIVITY_LEAD (CASE 

WHEN ("TABLE"."ABC" IN ('B'))

THEN "TABLE"."ABC"

 ELSE NULL END) IS NULL

THEN 1 ELSE 0 

END

) between 1 and 5 then '1 TO 5' ELSE '6+' END

Hi @anshuman.kher,

 

To make buckets you need to specify it as a dimension

 

Your Dimension would be like this I'd assume. I made it a bit simpler and more readable.

 

CASE WHEN

SUM ( CASE WHEN

"TABLE"."ABC"='A' AND ACTIVITY_LEAD ("TABLE"."ABC") = 'B'

THEN 0 ELSE 1 END)

BETWEEN 1 AND 5 then '1 TO 5' ELSE '6+' END

 

Let me know if this worked!

 

Kind regards,

Sverre Klein

 


Hello @sverre.klein11 ,

Thanks for getting back to this thread.

We have already tried the solution you have provided, but this will not work for us.

We are uploading an image. As you can see, we can create the buckets but they are getting assigned to each individual case. What we want is that the cases should get grouped into those buckets so that we can see how many cases falls under each bucket.

Below is the desired output we need, but we are failing to get the same. Please help us on the same.

Quick help will be highly appreciated.

 

Image1 (Current Output)

Image1Image2 (Desired Output)

Image2Regards,

Abdul Ansari

 


Hi @abdul.ansar,

 

Thanks for providing an example of your desired output.

 

Is it then not simply removing the caseNumber as a dimension from your OLAP table? The Dimension should be your Bucket (code provided earlier) and the KPI should be the COUNT_TABLE of your case table.

 

Let me know if that gets you the desired output.

 

Kind regards,

Sverre Klein


Reply