Skip to main content
Question

How can I get a single value from a PU Aggregation?

  • September 19, 2024
  • 3 replies
  • 35 views

Imagine I have two tables

 

  • Cases
    • Case ID
    • Customer
  • Activities
    • Case ID
    • Activity
    • Event Time

 

I would like to get the earliest "Upload" activity event time across all cases for a given customer.

 

It is easy for me to get the earliest "Upload" activity for each Case with:

 

PU_FIRST(Cases, Activities.Eventtime, Activities.Activity = 'Upload)

 

But this returns a row for every case.

 

I cannot figure out how to get the first of all these results. I tried domain tables, but couldn't figure out how to set it up.

 

Any thoughts?

3 replies

Forum|alt.badge.img+8
  • Level 0
  • 9 replies
  • September 23, 2024

Hi Matt,

Just wanted to know clearly, what exactly are you trying achieve by getting single value?

 


daniel.diers11
Level 4
Forum|alt.badge.img+1
  • Level 4
  • 10 replies
  • October 10, 2024

Please try the following

PU_FIRST(DOMAIN_TABLE(Activities.Activity), Activities.Eventtime, Activities.Activity = 'Upload’)

With this you’ll get the first Eventime per Activity and not per Case.


deepu.sebas11
Level 2
Forum|alt.badge.img
  • Level 2
  • 2 replies
  • October 11, 2024

By having customer name as Dimension and MIN(PU_FIRST(Cases, Activities.Eventtime, Activities.Activity = 'Upload)) will probably help you to get the desired result.