Defining the Values of Expanded vs. Collapsed Measures

Hi,

We’re looking to create an overview of vacation days per resource. An issue is created per vacation where Start Date is the date that vacation begins and End Date is the date that the vacation ends. A measure called “Used vacation days” also records the # of days taken (can exclude holidays, weekends, etc.).

If I use this calculated member I can get a view very close to what I’m looking for (top); however, I’d each date taken off to have a count of 1 (bottom) when expanded, instead of showing the total number of days on end date. For example, below I am taking 3 days off from January 9th to the 11th.

How can I give each date a count of 1 between the start and end date?

Thanks,

Mitch

Hi,

Could you please share the code for your calculated measure “Vacation Days Taken & Planned”? And please share more details for the measure “Used vacation days” that you mentioned in your question. Do you perhaps calculate that in Jira as scripted field which you later import in eazyBI?

Martins / eazyBI support

Hi Martins,

The code for the measure “Vacation Days Taken & Planned” is as follows:

[Measures].[Used vacation days with end date], [Status].[Approved]

The measure “Used vacation days” was automatically imported into EazyBI when we installed the plugin “Vacation Manager” for JIRA. In essence, we allocate X # of vacation days a year to each resource. The field “Used vacation days” records how many days of vacation they took. For example, if they took off Dec. 25, 26, & 27, then (in Canada) “Used vacation days” will be 1 since the 25th and 26th are holidays.

Please see below a screenshot of how a “Vacation” issue type looks with Start Date and End Date along with “Used vacation days”.

We ultimately want each day between Start Date and End Date to have a value of 1 when expanded. For example, if the user is on vacation Jan. 22, 23, 24, and 25th, then we want each of these 4 days to have a value of 1. Currently, using the Time dimension, the value of 4 is showing only on the “End Date” (Jan. 25th in this case).

Thanks,

Mitch

Hi Martins,

I think I’m getting close and have a method for achieving this, but cannot figure out a calculated measure to make it work.

I have found 2 measures “Used vacation days with start date” (the “Start Date” of the vacation) and “Used vacation days with end date” (the “End Date” of the vacation).

How can I create assign a value of 1 to each of the dates between “Used vacation days with start date” and “Used vacation days with end date”?

I have tried something like the below with no luck:

CASE WHEN(
DateCompare([Measures].[Used vacation days with end date],
[Measures].[Used vacation days with start date]) = -1)
THEN 1
ELSE NULL
END

Thanks,

Mitch

Hi Mitchell,

eazyBI doesn’t have an integration with Vacation Manager add-on, however, there is a workaround you may want to try in this case.

What I find strange is in your Jira ticket screenshot I see that “used vacation days” field results does not include additional holidays from Jira holiday scheme, does it?

See following attachments with my findings:

And you are right, when importing cf “used vacation days” as measure in eazyBI there is a set of new measures created and if you use any of them it would show results only at the first and last date of vacation period by default.

Here is what you could do in your case to return counter 1 for each date which belong to vacation.

Create a new calculated member in “Measures” dimension to calculate results at day level and show them for each day between vacation start and end dates.

This is the code from my report (see attached image below):

Nonzero(
Count(
Filter(
Descendants([Time].CurrentHierarchyMember,[Time].[Day]),
DateDiffWorkDays(
      [Time].CurrentHierarchyMember.StartDate,
      [Time].CurrentHierarchyMember.NextStartDate
    )>0
AND
DateBeforePeriodEnd(
Order(
Filter(
  [Time].[Day].Members,
  [Measures].[Used vacation days with start date]>0
  ),
  [Time].CurrentMember.Startdate,
  BASC 
).item(0).Startdate,
[Time].CurrentHierarchyMember
)
AND
DateAfterPeriodEnd(
Order(
Filter(
  [Time].[Day].Members,
  [Measures].[Used vacation days with end date]>0
  ),
  [Time].CurrentMember.Startdate,
  BDESC 
).item(0).Startdate,
[Time].CurrentHierarchyMember.PrevMember
)
)
)
)

By doing so you may notice that some future (and past) dates may not be available in “Time” dimension because eazyBI creates dimension members based on issue field timestamps. If none of the actions are happening in the date, this date is not created by default in “Time” dimension. That means that calculation seems incorrect, which is true unless you add all time members for “Time” dimension.
That is why you would need to manually add missing date members for past and future dates. It is safe to add date members for larger periods.
Please find our documentation page how to add missing date members: https://docs.eazybi.com/display/EAZYBI/Create+reports#Createreports-AddmemberstoTimedimension

One more thing - all additional holidays additonaly should be define in eazyBI import options (even if you already have them Jira). The code above knows how to exclude regular workingdays, but additonal holidays is thing that must be defined via Time options
https://docs.eazybi.com/display/EAZYBIJIRA/Jira+Issues+Import#JiraIssuesImport-Timedimension

Actually, you could try importing the report definition from below. It should create this calculated measure and final eazyBI report for you.

{
  "cube_name": "Issues",
  "cube_reports": [ {
     "name": "Report vacation",
     "result_view": "table",
     "definition": {"columns":{"dimensions":[{"name":"Measures","selected_set":["[Measures].[Count of vacation days]"],"members":[]},{"name":"Reporter","selected_set":["[Reporter].[User].Members"],"members":[],"bookmarked_members":[]}]},"rows":{"dimensions":[{"name":"Time","selected_set":["[Time].[2018]","[Time].[2019]"],"selected_set_expression":"DescendantsSet({{selected_set}}, [Time].[Day])","members":[],"bookmarked_members":[]}],"nonempty_crossjoin":true},"pages":{"dimensions":[{"name":"Status","selected_set":["[Status].[All Statuses]"],"members":[{"depth":0,"name":"All Statuses","full_name":"[Status].[All Statuses]","drillable":true,"type":"all","expanded":true,"drilled_into":false},{"depth":1,"name":"Approved","full_name":"[Status].[Approved]","parent_full_name":"[Status].[All Statuses]"}],"bookmarked_members":[],"current_page_members":["[Status].[Approved]"]},{"name":"Project","selected_set":["[Project].[All Projects]"],"members":[{"depth":0,"name":"All Projects","full_name":"[Project].[All Projects]","drillable":true,"type":"all","expanded":true,"drilled_into":false},{"depth":1,"name":"Vacation Manager","full_name":"[Project].[Vacation Manager]","drillable":true,"key":"VACMAN","parent_full_name":"[Project].[All Projects]"}],"bookmarked_members":[],"current_page_members":["[Project].[Vacation Manager]"]},{"name":"Time","duplicate":true,"selected_set":["[Time].[All Times]"],"members":[{"depth":0,"name":"All Times","full_name":"[Time].[All Times]","drillable":true,"type":"all","expanded":true,"drilled_into":false},{"depth":1,"name":"2018","full_name":"[Time].[2018]","drillable":true,"parent_full_name":"[Time].[All Times]"},{"depth":1,"name":"2019","full_name":"[Time].[2019]","drillable":true,"expanded":true,"drilled_into":false,"parent_full_name":"[Time].[All Times]"},{"depth":2,"name":"Q1 2019","full_name":"[Time].[2019].[Q1 2019]","drillable":true,"expanded":true,"drilled_into":false,"parent_full_name":"[Time].[2019]"},{"depth":3,"name":"Jan 2019","full_name":"[Time].[2019].[Q1 2019].[Jan 2019]","drillable":true,"expanded":true,"drilled_into":false,"parent_full_name":"[Time].[2019].[Q1 2019]"}],"bookmarked_members":[],"current_page_members":["[Time].[2018]","[Time].[2019]"]}]},"options":{"nonempty":true},"view":{"current":"table","maximized":false,"table":{}}}
  } ],
  "calculated_members": [{"name":"Count of vacation days","dimension":"Measures","formula":"Nonzero(\nCount(\nFilter(\nDescendants([Time].CurrentHierarchyMember,[Time].[Day]),\nDateDiffWorkDays(\n      [Time].CurrentHierarchyMember.StartDate,\n      [Time].CurrentHierarchyMember.NextStartDate\n    )>0\nAND\nDateBeforePeriodEnd(\n\nOrder(\nFilter(\n  [Time].[Day].Members,\n  [Measures].[Used vacation days with start date]>0\n  ),\n  [Time].CurrentMember.Startdate,\n  BASC \n).item(0).Startdate\n,\n[Time].CurrentHierarchyMember\n)\nAND\nDateAfterPeriodEnd(\nOrder(\nFilter(\n  [Time].[Day].Members,\n  [Measures].[Used vacation days with end date]>0\n  ),\n  [Time].CurrentMember.Startdate,\n  BDESC \n).item(0).Startdate\n\n\n,\n[Time].CurrentHierarchyMember.PrevMember\n)\n)\n)\n)","format_string":"#,##0"}]
}

Martins / eazyBI support