-
1. Re: Dual Axis Gantt Bar - How To Exclude Values From Second Axis from Values on First
Lisa Li Mar 1, 2017 1:31 PM (in response to Leanne Vermeulen)Hey Leanne,
You can try this calculation that determines if there is an overlap between the gray and purple gantt bars:
if [Room Avail From Time]>[Agenda Start Time] AND [Room Avail From Time]<[Agenda End Time] then
datediff('hour',[Room Avail From Time],[Room Avail TIll Time])-
datediff('hour',[Room Avail From Time],[Agenda End Time])
elseif [Room Avail From Time]<[Agenda Start Time] AND [Room Avail Till Time]<[Agenda End Time] then
datediff('hour',[Room Avail From Time],[Room Avail TIll Time])-
datediff('hour',[Agenda Start Time],[Room Avail TIll Time])
elseif [Room Avail From Time]<[Agenda Start Time] AND [Room Avail From Time]<[Agenda End Time] then
datediff('hour',[Room Avail From Time],[Room Avail TIll Time])-
datediff('hour',[Agenda Start Time],[Agenda End Time])
END
To find the duration of any of the gantt bars, you can use datediff respective to the Room Avail or Agenda Time.
Hope this helps!
-Lisa
-
2. Re: Dual Axis Gantt Bar - How To Exclude Values From Second Axis from Values on First
Leanne Vermeulen Mar 1, 2017 1:47 PM (in response to Lisa Li)Hey Lisa,
Thanks so much for taking the time out to write this! How would I 'test' this calculation / where would I apply it?
-
3. Re: Dual Axis Gantt Bar - How To Exclude Values From Second Axis from Values on First
Lisa Li Mar 1, 2017 2:02 PM (in response to Leanne Vermeulen)Depends on how you want to visualize the information. I have attached the twbx file with my edits.
-Lisa
-
Dual Axes Gantt Bar_edits.twbx 39.7 KB
-
-
4. Re: Dual Axis Gantt Bar - How To Exclude Values From Second Axis from Values on First
Leanne Vermeulen Mar 2, 2017 12:20 AM (in response to Lisa Li)Oh I see what you've done there - the thing is I want to display this info as bars in the Gantt Chart, not just numerical values. So the problem is figuring out how to calculate new starting points that are relevant to the new starting hours, based on the remaining hours. That's the part I'm not sure how to calculate. I'm starting to think that because it involves a date part of 'hour', there's no way to create that type of Gantt Chart without altering the data source itself to contain those newly created starting points. Calculating them there is still going to be tricky though.
-
5. Re: Dual Axis Gantt Bar - How To Exclude Values From Second Axis from Values on First
Lisa Li Mar 2, 2017 9:48 AM (in response to Leanne Vermeulen)Hey Leanne,
You can use similar logic to define a start time for "remaining time"
if [Room Avail From Time]>[Agenda Start Time] AND [Room Avail From Time]<[Agenda End Time] then
[Agenda End Time]
elseif [Room Avail From Time]<[Agenda Start Time] AND [Room Avail TIll Time]<[Agenda End Time] then
[Room Avail From Time]
elseif [Room Avail From Time]<[Agenda Start Time] AND [Room Avail From Time]<[Agenda End Time] then
[Room Avail From Time]
elseif [Room Avail TIll Time]>[Agenda End Time] AND [Room Avail TIll Time]>[Agenda End Time] then
[Agenda End Time]
END
This might work. I'm not able to test it out currently, but please let me know what happens!
-Lisa
-
6. Re: Dual Axis Gantt Bar - How To Exclude Values From Second Axis from Values on First
Leanne Vermeulen Mar 3, 2017 8:29 AM (in response to Lisa Li)Mmm, almost! It's definitely producing new starting points, but they don't appear to be accurate (I think - I was in a hurry when I tried it out this morning!) I'm going to play around a bit with the code you provided and see if I can tweak it until it's perfect and get back to you, because it's definitely almost there!