Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

bijukrishnan
New Contributor III

Plotting bar graph with distinct time values

Hi,

I'm new to Qlik Sense and trying to create a simple visualization but struggling with what I wish to achieve.

I have table which looks like this

BTimeHHMMDestination
09:43Home
04:36Walking
05:29Office
08:52Walking
09:07Pub
09:57Walking
13:44Office

I was hoping to plot a bar graph with the count of how many times I have visited office during certain class of hours. So between

05:00 - 06:00 - 1

13:00 . 14:00 - 1

And so on.

bar graph.png

Problem is that time keeps repeating itself.

OR something like the google popular time would also do

google popular times.png

I would prefer to have the calculation in the dimension or measure rather than in the load script but this is just because editing the load script will break the data manager.

Thanks in advance.

Regards,

Biju

3 Replies
theglenndavid
New Contributor III

Re: Plotting bar graph with distinct time values

I think this can be done by simply using Time(BTimeHHMM,'h tt') as dimension.

bijukrishnan
New Contributor III

Re: Plotting bar graph with distinct time values

Hi Glenn,

We have to implement a class here as I understand, so that all the visits during say 9-10, 10-11 etc need to be grouped as one.

I tried your suggestion and its great to see the plot being displayed in AM/PM but there are multiple entries for 09 for example and not just one entry on the X axis.

TimeIssue.png

Thanks for your time and let me know if you have other suggestions.

bijukrishnan
New Contributor III

Re: Plotting bar graph with distinct time values

My colleagues helped me with it. The trick was to load the data with the Left statement and cast into another variable.

statement that works

Left(Time([BeginTime], 'hh'),2) AS BHour;

statement that does not work

Time([BeginTime], 'hh') AS BHour

visit to office.png

Community Browser