13 Replies Latest reply on Feb 15, 2017 3:10 AM by Norbert Maijoor

Using date (only count of days) intervals in Tableau - visualization on the axis

Hi,

I am working on a data set with day intervals. So for example day 260-320. Or 182-242.  This is the count of the days.

Which means the days the mice had a specific treatment. So from day 260 to 320 they had treatment X. And that treatment is a measure (radiation).

So just # days , no specific months, years, hours or anything. But it would be great to plot it on the axis with the day ranges.

What is the best option for visualizing these date intervals (ranges)? Is there a way to convert this to a date range or something?

I was thinking of creating a split with a start day and end day. But how to make sure Tableau sees this as actual days? So you would get start day 260 and end day 320.

I have tried everything but I think the solution must be very simple.

Thank you in advance for your suggestions!

Best,

Sylvia

I have added the workbook with data. Message was edited by: Sylvia J. van Woerkom

• 1. Re: Using date (only count of days) intervals in Tableau - help

Goedenavond Sylvia,

Find my approach based in datediff below and stored in attached workbook version 9.3

Days 0-99: if datediff('day',[Date],today()+47)<100 then [Number of Records] END

• 2. Re: Using date (only count of days) intervals in Tableau - help

Hi Norbert,

Thank you so much for replying! I have added some extra context here.

I have added a screenshot here of the type of data that I have and what I am trying to achieve.

Correct visualization of a range and various values above.

My data:

Above is the day range for which I have certain measures/values. So 77-273 means day 77 till day 273.

I created a split, but that doesn't seem to work when trying to plot the various values on the axis with a range of days.

I would like to have a smooth range here and visualize a connecting line from the beginning point to the end point instead of these separate bars.

This is what I get, it makes no sense

Any other ideas for:

-Getting the date ranges (intervals) correct? Should I do something with grouping, changing the date format (although I have already tried every option there was) Is something wrong with dimensions/measures?

-Visualizing the values in the ranges

Thanks! -Sylvia

• 3. Re: Using date (only count of days) intervals in Tableau - help

Also tried your calculations for DateDiff.

Maybe I'm doing something fundamentally wrong.

1 of 1 people found this helpful
• 4. Re: Using date (only count of days) intervals in Tableau - help

HI Sylvia,

Thanks for prompt reply. Are you able to share your workbook?

• 5. Re: Using date (only count of days) intervals in Tableau - help

Hi Norbert,

I have attached it here.

-Days Fibrosis

-Days Pneumonitis

Have the day intervals. Some overlap I believe I am doing something wrong here.

I would like to plot the values on the axis like a continuous range, so example from 90 to 400.

• 6. Re: Using date (only count of days) intervals in Tableau - help

Nogmaals goedenavond Sylvia,

Find my updated approach as reference below and stored in attached workbook version 10.1

Not sure but I think you would like to "group" e.g. Days Fibrosis

• 7. Re: Using date (only count of days) intervals in Tableau - help

Hi Norbert,

First of all thank you for all the effort! Appreciate it!

We're getting somewhere.

I try to display the day range as a line or bar, for example: Begin day 252 and end day 364. So you will see on straigth line from begin to end day, for example for the dosis of 13.00 here and Stain CBA/Ht.

And on the X-axis the chronological display of days.

I found some examples on the internet:

Below:

Mouse with dosis 16,00 and dose rate 4.13 had complications starting from day 95 (pneumonitis).

That same mouse had worse complications (fibrosis) starting on day 364.

I would like to visualize when these 2 complications start to occur, in what date range. Compared to the dosis they had (on Y- axis).

Couple of questions:

-Should I manipulate the data to be able to visualize this correctly, if so, how?

-What is the right setting for visualizing these date ranges (Date Type/Measure/Continuous) ?

Ideally I would like to have time (in days) on the X-axis and the range of days in Pneumonitis and Days of Fibrosis visualized in different colours on the canvas like a bar or line or something else.

On the Y-axis the applied 'Dosis'.

Something like this (Gantt chart):

or

-Do I have to make use of calculations? If so, what should I try? (Datediff did not work for me here )

-Any good suggestions for visualizing this in general?

I've just added a new update of the workbook.

Thank you so much for your time!

-Sylvia

1 of 1 people found this helpful
• 8. Re: Using date (only count of days) intervals in Tableau - help

Hi Sylvia,

To get a Gantt chart, split Days Fibrosis into Start and End Days. Calculate Duration (days) and create a dual axis Gantt chart. You need to place Duration on size. You can create an additional Ranking field and put it in the appropriate place depending on your sorting preferences. I have done this for Fibrosis. If this is what you want, then you can replicate it for Pneumonitis.

See attached modified workbook in Tableau 10.

3 of 3 people found this helpful
• 9. Re: Using date (only count of days) intervals in Tableau - help

Goedemorgen Sylvia,

During the night Okechukwu Ossai did it

1 of 1 people found this helpful
• 10. Re: Using date (only count of days) intervals in Tableau - visualization on the axis

Hi all,

I wanted to thank you for your contribution and efforts!

It really helped me to continue my analysis. Will keep you posted on the end results

Thank you so much!

-Sylvia

• 11. Re: Using date (only count of days) intervals in Tableau - visualization on the axis

Goedemorgen Sylvia,

It's always NICE:) when "a plan comes together"......