Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate date delta on a min and max date from a set of selected Time dimension

Jerome Renaud
Contributor
October 4, 2018

Hi,

I have a Time dimension on the "pages" (filter) section. I want to create a calculated measure, where I want to return the number of workdays using the DateDiffWorkdays function. So, I need to retrieve the Min and Max date of my selection (assuming multiple selection).

How can I do that (using EazyBI 4.6.0 and Jira 7)

Thanks for your help!

1 answer

1 accepted

0 votes
Answer accepted
Lauma Cīrule
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 8, 2018

Hi @Jerome Renaud,

You could generate the set of all days and get the first and last item from it. Please try the following formula

DateDiffWorkdays(Generate(
    ChildrenSet([Time].CurrentHierarchyMember),
    Descendants([Time].CurrentHierarchyMember, [Time].[Day])
  ).Item(0).StartDate,
  Tail(Generate(
    ChildrenSet([Time].CurrentHierarchyMember),
    Descendants([Time].CurrentHierarchyMember, [Time].[Day])
  )).Item(0).StartDate
)

 

Lauma / support@eazybi.com

Jerome Renaud
Contributor
November 7, 2018

Works perfectly, thanks!

Like Lauma Cīrule likes this

Suggest an answer

Log in or Sign up to answer