Skip to main content

 

I would like to sum this resulting column up and get an INT for example.

 

CASE WHEN(

  CALC_THROUGHPUT(FIRST_OCCURRENCEN'Sendung elektronisch angekündigt']

  TO LAST_OCCURRENCER'In der Region des Empfängers angekommen'],

  REMAP_TIMESTAMPS("Amzn_activity_table_xlsx_Tabelle1"."TIMESTAMP", MINUTES))

  >

  GLOBAL(

    AVG(

    CALC_THROUGHPUT(FIRST_OCCURRENCES'Sendung elektronisch angekündigt']

    TO LAST_OCCURRENCE 'In der Region des Empfängers angekommen'],

    REMAP_TIMESTAMPS("Amzn_activity_table_xlsx_Tabelle1"."TIMESTAMP", MINUTES))

    )

    *1.2)

) THEN 1 ELSE 0 END

 

imageimage.png

Hi Marius,

 

The problem is not so much using a GLOBAL() within a standard aggregation, but rather using a standard aggregation (AVG) within another standard aggregation (SUM).

 

To avoid doing that you will need to use a PU function, in this case I'm assuming you need to compare to an overall avg throughput time, which is a single value. If that's the case you should use PU_AVG, with CONSTANT()

 

Please try the following snippet, and let me know if that's what you're looking for.

 

CASE WHEN(

 CALC_THROUGHPUT(FIRST_OCCURRENCER'Sendung elektronisch angekündigt']

 TO LAST_OCCURRENCEU'In der Region des Empfängers angekommen'],

 REMAP_TIMESTAMPS("Amzn_activity_table_xlsx_Tabelle1"."TIMESTAMP", MINUTES))

 >

PU_AVG(

CONSTANT()

  ,CALC_THROUGHPUT(FIRST_OCCURRENCET'Sendung elektronisch angekündigt']

  TO LAST_OCCURRENCEL'In der Region des Empfängers angekommen'],

  REMAP_TIMESTAMPS("Amzn_activity_table_xlsx_Tabelle1"."TIMESTAMP", MINUTES)

  )

  *1.2)

) THEN 1 ELSE 0 END

 

Please upvote and mark as the best answer if it solved your issue.

Thanks!

 

Eugene - Ashling Parnters


Reply