Skip to main content
Solved

i want to setup a olap table in the studio and I have this PQL formula: Do you know how I would work?

  • February 2, 2023
  • 9 replies
  • 21 views

jonas.frisc
Level 4

CASE WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Veredelung%') THEN COUNT ( "AE_SIGNALS"."SIGNAL_ID" ) * 30 / 60 ELSE NULL END

I get the following error:

The aggregation function COUNT cannot be used together with a dimension function input. Please check that there are no aggregations and dimensions used together as function inputs.

Best answer by rio.cinco12

Hi, are you looking for count of this two skills with some operations. I think you can add both results, it should yield the same result.

 

COUNT(

CASE WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Veredelung%') 

THEN "AE_SIGNALS"."SIGNAL_ID" ELSE NULL END ) * 30 / 60

+

COUNT(

CASE WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Warnweste%') 

THEN "AE_SIGNALS"."SIGNAL_ID" ELSE NULL END ) * 45 / 60

9 replies

Try PU_COUNT() instead


jonas.frisc
Level 4
  • Author
  • Level 4
  • 7 replies
  • February 2, 2023

@Guillermo Gost Unfortunately it does not work with that either.


Forum|alt.badge.img+14
  • Level 8
  • 57 replies
  • February 2, 2023

you can try something like :

COUNT(

CASE WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Veredelung%') 

THEN "AE_SIGNALS"."SIGNAL_ID" ELSE NULL END ) * 30 / 60


matt.witty13
Level 10
  • Level 10
  • 123 replies
  • February 6, 2023

you can try something like :

COUNT(

CASE WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Veredelung%') 

THEN "AE_SIGNALS"."SIGNAL_ID" ELSE NULL END ) * 30 / 60

Can also be written as:

 

SUM(

CASE

WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Veredelung%')

THEN 1.0

ELSE 0.0

END)

*30 / 60


wein.nadin
Level 4
Forum|alt.badge.img
  • Level 4
  • 3 replies
  • February 7, 2023

@rio.cinco12 this one works, thank you for that.

Do you have an idea to set this up for more then one option?

I'd like to count two different cases with different amounts.

 

F.e.

COUNT(

CASE

WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Veredlung%')

THEN ("AE_SIGNALS"."SIGNAL_ID") * 30 / 60

WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Warnweste%')

THEN ("AE_SIGNALS"."SIGNAL_ID") * 45 / 60

ELSE NULL END)

 

Error:

Operator requirements are not met. Operator 'MULT' is not compatible with inputs of type STRING and INT.

Thanks in advance!

 

 


Forum|alt.badge.img+14
  • Level 8
  • 57 replies
  • Answer
  • February 7, 2023

Hi, are you looking for count of this two skills with some operations. I think you can add both results, it should yield the same result.

 

COUNT(

CASE WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Veredelung%') 

THEN "AE_SIGNALS"."SIGNAL_ID" ELSE NULL END ) * 30 / 60

+

COUNT(

CASE WHEN "AE_SIGNALS"."AE_SKILL_NAME" LIKE ('%Warnweste%') 

THEN "AE_SIGNALS"."SIGNAL_ID" ELSE NULL END ) * 45 / 60


wein.nadin
Level 4
Forum|alt.badge.img
  • Level 4
  • 3 replies
  • February 7, 2023

Hi @rio.cinco12 I'd like to have an either operation.

So If it's ('%Veredelung%') i need the amount of *30/60 and if it's ('%Warnweste%') i need the amount of * 45/60.


Forum|alt.badge.img+14
  • Level 8
  • 57 replies
  • February 8, 2023

Hi @rio.cinco12 I'd like to have an either operation.

So If it's ('%Veredelung%') i need the amount of *30/60 and if it's ('%Warnweste%') i need the amount of * 45/60.

Hi, is the above code works for you ?


wein.nadin
Level 4
Forum|alt.badge.img
  • Level 4
  • 3 replies
  • February 20, 2023

Hi, is the above code works for you ?

Hi @rio.cinco12  - yes perfect, thanks!