Skip to main content

In my current UseCase i do have the following issue:

 

I have five transporters. Each of the them transports 5 packages.

Therefore i do have 25 rows in my table.

 

I also have the time when the packages need to be delivered and when the transporter delivered them.

 

I want my pie-chart to show how many transporters delevered their entire load of packages on time and how many did deliver at least one package to late.

 

image

Hi Andreas,

 

Try this setup:

 

Dimension:

CASE WHEN 

PU_COUNT(

  DOMAIN_TABLE("TEST_csv"."TRANSPORTER_ID")

  ,"TEST_csv"."TRANSPORTER_ID"

  ,PU_COUNT(

    DOMAIN_TABLE("TEST_csv"."TRANSPORTER_ID")

    ,"TEST_csv"."PKG_ID"

    ,MINUTES_BETWEEN("TEST_csv"."ACTUAL","TEST_csv"."SLA") < 0

  ) > 0

) > 0 THEN 'TRANSPORTER WITH AT LEAST ONE PACKAGE DELIVERED LATE'

ELSE 'TRANSPORTER ON TIME'

END

 

KPI:

COUNT(DISTINCT "TEST_csv"."TRANSPORTER_ID")

 

SLA = need to be delivered

ACTUAL = is delivered


Please upvote if helpful


Hi Andreas,

 

Try this setup:

 

Dimension:

CASE WHEN 

PU_COUNT(

  DOMAIN_TABLE("TEST_csv"."TRANSPORTER_ID")

  ,"TEST_csv"."TRANSPORTER_ID"

  ,PU_COUNT(

    DOMAIN_TABLE("TEST_csv"."TRANSPORTER_ID")

    ,"TEST_csv"."PKG_ID"

    ,MINUTES_BETWEEN("TEST_csv"."ACTUAL","TEST_csv"."SLA") < 0

  ) > 0

) > 0 THEN 'TRANSPORTER WITH AT LEAST ONE PACKAGE DELIVERED LATE'

ELSE 'TRANSPORTER ON TIME'

END

 

KPI:

COUNT(DISTINCT "TEST_csv"."TRANSPORTER_ID")

 

SLA = need to be delivered

ACTUAL = is delivered

Hi Eugene,

 

thanks for your efforts.

 

Unfortunately the query does not give me the right output.

 

Dimension:

CASE WHEN

PU_COUNT(DOMAIN_TABLE("ACTIVITIES"."CASE_ID")

  ,"ACTIVITIES"."CASE_ID"

  , PU_COUNT(

    DOMAIN_TABLE("ACTIVITIES"."CASE_ID")

    ,"ACTIVITIES"."HANDLINGUNIT"

    ,MINUTES_BETWEEN ( "ACTIVITIES"."GEPLANTER_BEDARFSZEITPUNKT", "ACTIVITIES"."TIMESTAMP_QUIT" )<0

    )>0

  )>0 THEN 'to late' ELSE 'on time' END

 

KPI:

COUNT(DISTINCT "ACTIVITIES"."CASE_ID")

 

OUTPUT:

to late: 344

on time: 1

 

 

Desired Output:

to late: 30

on time: 315

 

best regards,

Andreas


Hi Andreas,

 

Try this setup:

 

Dimension:

CASE WHEN 

PU_COUNT(

  DOMAIN_TABLE("TEST_csv"."TRANSPORTER_ID")

  ,"TEST_csv"."TRANSPORTER_ID"

  ,PU_COUNT(

    DOMAIN_TABLE("TEST_csv"."TRANSPORTER_ID")

    ,"TEST_csv"."PKG_ID"

    ,MINUTES_BETWEEN("TEST_csv"."ACTUAL","TEST_csv"."SLA") < 0

  ) > 0

) > 0 THEN 'TRANSPORTER WITH AT LEAST ONE PACKAGE DELIVERED LATE'

ELSE 'TRANSPORTER ON TIME'

END

 

KPI:

COUNT(DISTINCT "TEST_csv"."TRANSPORTER_ID")

 

SLA = need to be delivered

ACTUAL = is delivered

The hint to create the query with the "DOMAIN_TABLE"-statement was worth gold!! Tahnks for that Eugene.

 

I now did it this way in the dimension:

 

 

CASE WHEN

PU_COUNT(DOMAIN_TABLE ( "ACTIVITIES"."CASE_ID"), "ACTIVITIES"."CASE_ID",

MINUTES_BETWEEN ( "ACTIVITIES"."GEPLANTER_BEDARFSZEITPUNKT", "ACTIVITIES"."TIMESTAMP_QUIT" )>0

)>0

 

 

THEN 'to late' else 'on time' end


The hint to create the query with the "DOMAIN_TABLE"-statement was worth gold!! Tahnks for that Eugene.

 

I now did it this way in the dimension:

 

 

CASE WHEN

PU_COUNT(DOMAIN_TABLE ( "ACTIVITIES"."CASE_ID"), "ACTIVITIES"."CASE_ID",

MINUTES_BETWEEN ( "ACTIVITIES"."GEPLANTER_BEDARFSZEITPUNKT", "ACTIVITIES"."TIMESTAMP_QUIT" )>0

)>0

 

 

THEN 'to late' else 'on time' end

Oh, now that I see the actual table names - you can use the cases table instead of domain table with activity.case_key, it should yield the same result. In any case - glad you were able to make this work!


Reply