Skip to main content
Question

Pie Chart Dimensions Issue

  • February 17, 2022
  • 5 replies
  • 4 views

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

5 replies

Forum|alt.badge.img+13
  • Level 7
  • February 21, 2022

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


Forum|alt.badge.img+13
  • Level 7
  • February 21, 2022

Please upvote if helpful


  • Author
  • Level 2
  • February 22, 2022

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


  • Author
  • Level 2
  • February 22, 2022

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


Forum|alt.badge.img+13
  • Level 7
  • February 23, 2022

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!