Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
vupen
Partner - Creator
Partner - Creator

Bar/Gauge chart to show usage for specific time periods in a given day

Hi

I am working on creating a chart (bar/gauge in Straight table) to show the room usage in a day.

We know the usage might not be continous in terms of the time of the day. I got to the halway mark, where I can set the offset of the bar to differentiate the start of each piece of the bar, but what I need is to merge all these individual pieces into a single bar.

error loading image

Please suggest a suitable solution.

Attached are my working files.

Thanks

Upendra

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

The chart is only plotting durations, and knows nothing of timestamps. Since your first record starts at 1:18 AM, the chart is missing the data for that first hour and 18 minutes. The chart isn't smart enough to recognize that since the room was occupied starting at 1:18 AM, then it must have been vacant prior to that. You have to be explicit.

There might be a way around it, but as I set the example up, you need records that cover the entire day, and that are specific to the day. So your very first record for the day must start at midnight. Your very last record of the day must end at midnight. They can't overlap, and they can't miss any time, or the chart will be wrong.

View solution in original post

6 Replies
johnw
Champion III
Champion III

I've modified an existing example of mine to demonstrate one approach. In this case, it is tracking whether given doors are open or closed. For the graph, I'm assuming that you're selecting one and only one day. I'm showing closed doors in green, and open doors in red. In your case, you would just use white for the color when the room is not in use. The basic idea is to use a stacked bar graph with the durations of each room being in each state.

johnw
Champion III
Champion III

Here's a completely different approach with half hour intervals, similar to what you appeared to be doing.

vupen
Partner - Creator
Partner - Creator
Author

From the appearance, the chart in testDoorOpenClosed.qvw seems to match my requirement. Let me try to replicate on the lines similiar to yours'.

Thanks for the sample.

Upendra

vupen
Partner - Creator
Partner - Creator
Author

I have made appropriate changes to the sample you have provided. But I am not able to get the times lines correct. Can you please find out where I went wrong?

Thanks
Upendra

johnw
Champion III
Champion III

The chart is only plotting durations, and knows nothing of timestamps. Since your first record starts at 1:18 AM, the chart is missing the data for that first hour and 18 minutes. The chart isn't smart enough to recognize that since the room was occupied starting at 1:18 AM, then it must have been vacant prior to that. You have to be explicit.

There might be a way around it, but as I set the example up, you need records that cover the entire day, and that are specific to the day. So your very first record for the day must start at midnight. Your very last record of the day must end at midnight. They can't overlap, and they can't miss any time, or the chart will be wrong.

vupen
Partner - Creator
Partner - Creator
Author

I have realized this.. Thanks for the help.

Upendra