Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
JacobJones
Creator
Creator

getting the min date in an average of networkdays

So this is what I want to work:

 

AVG( NetWorkDays([AxUDV_CaseTriage.Date Case Received], min([Date of Appointment]), Holiday)))

 

but I am getting the error, Nested aggregation is not allowed. In the table one Patient ID has multiple appointments and I want to calculate the time between the Date Case Received and the first appointment. I've tried set analysis and aggr(), but so far no luck.

 

How can I do this?

1 Solution

Accepted Solutions
sunny_talwar

How about this

Avg(Aggr(
  NetWorkDays([AxUDV_CaseTriage.Date Case Received], Min([Date of Appointment]), Holiday)
, [Patient ID]))

 

View solution in original post

4 Replies
Vegar
MVP
MVP

Do you bet a correct value if you remove the avg() and select a single patient?

 

If patient ID is a dimension in your table then you should probably  try to aggregate on that dimension.

AVG( NetWorkDays([AxUDV_CaseTriage.Date Case Received], min([Date of Appointment]), Holiday), [Patient ID])

 

JacobJones
Creator
Creator
Author

The error is with the nested aggregation. 

 

sunny_talwar

How about this

Avg(Aggr(
  NetWorkDays([AxUDV_CaseTriage.Date Case Received], Min([Date of Appointment]), Holiday)
, [Patient ID]))

 

JacobJones
Creator
Creator
Author

Thank you so much 🙂