Graph how many users are currently logged in

Hi

is there an easy way to create a diagram for us to see how many users are logged in on average days.
we host a platform where students get free of charge help and need to align better when our tutors are logged in and can help…

The data we have:
date tutorID loginTime logoutTime

so on a single date, multiple rows show all tutors and when available (time btw login and logout)
and every tutor is listed for all days when logged in

desired output is a chart (like a bar chart or anything even better) where we can see:
from 0AM to 1AM : 0 tutors
from 1AM to 2AM: 2 tutors

from 9AM to 10AM: 25 tutors
and so on

I researched and played around, but have not found a way.
Tried to crate 24 columns (1 for each hour of the day), then mark it with “1” if tutor available (which I did not succeed so far), then calculate the sum for each column and do a bar chart (which works).
But as I did not fully succeed so far and this seems far to complicated, I look for a good idea of someone more familiar with KNIME than me.

Appreciate your help!
Jürgen

1 Like

Hi Jürgen (@JN75 ),

welcome to the Community!

Your task sound very similar the “Diurnal Curve - Tageskurve / Task Curve - Auftragskurve”-post from earlier (and your approach sounds pretty close to mine):

Maybe you can reuse the workflow there and adjust it to your needs?

Let me know if this works for you!
Best, Lukas

3 Likes

Dear Lukas,

thank you for the quick answer.
I loaded your workflow and tried, looks very promising.
I need to analyze each node now and understand what exactly it is doing and why. I think I will be able to adapt to my needs.

All the best to you,
Jürgen

1 Like

success :slight_smile:

exactly what we where looking for and a big help for future work

Thank you again, Lukas!

4 Likes

You are very welcome, I’m glad it helped! :slight_smile:

I just noticed these sections in your plot:
image

Looks like there are a duplicate entries at these times: If this should be an issue, you can use the “Group-by” Node, group by the ‘time’-column and do a meaningful aggregation on the ‘number of tutors online’-column, e.g. sum or max. I just happend to have struggled with the exact same thing :wink:

3 Likes

I fixed that yesterday via duplicate row filter and keeping the row with maximum y-value.
I also implemented a bar chart which is much nicer.

currently I am struggling with automatic calculation of days btw 2 flow variables (that are of type string).
I tried with “Java edit variable”, but am not clever enough to case 2 strings of format YYYY-MM-DD into 2 dates that can be subtracted from each other.
I use these 2 flow variables to filter rows at the beginning and to insert an automated chart subtitle…
Please check my latest chart:

2 Likes

typo. I wanted to say “cast 2 strings …”

Nice plot!

In this case I’d do some Date&Time <-> string conversion before converting to flow variables to use the “Date&Time Difference”-Node like so:

2 Likes

you are clever and experienced.
Don’t you want to join our team? Just friendly asking, no obligations! :slight_smile:
check out www.naklar.io if you are curious of what we are doing…

I modified slightly as I need the interval as a number and increase it by 1.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.