Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
inescastelhano
Partner - Creator II
Partner - Creator II

Line chart with two dimensions in one

Dear All,

I am trying to create a plot similar to the one displayed below, but with two lines. On the x axis, I would like to have one single dimension, representing the time of the day (in hours, from 0 to 23).

The aim of the plot is to show the number of people who arrive to the hospital by hour, and the number of people who leave the hospital by hour. One line for each.

So, should I have one single dimension for both, or separated dimensions?

Any ideas?

Thanks in advance.

Cheers,

Inesplot.PNG

1 Solution

Accepted Solutions
MarcoWedel

with two seperate fields I guess you mean arrival and leaving timestamps.

You could solve this by creating a canonical date (or in this case time):

Canonical Date

hope this helps

regards

Marco

View solution in original post

10 Replies
Anonymous
Not applicable

I would go for one dimension and two expressions.

inescastelhano
Partner - Creator II
Partner - Creator II
Author

The problem is that I load two separate fields from the fact table. How can I merge them into one and associate the number of people?

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you share some sample data or application then it would be easier to solve.  I think for this scenario you can use Hour as dimension and two expressions like

Sum(PatientsArrived)

Sum(PatientsLeft)

Regards,

Jagan.

MarcoWedel

with two seperate fields I guess you mean arrival and leaving timestamps.

You could solve this by creating a canonical date (or in this case time):

Canonical Date

hope this helps

regards

Marco

buzzy996
Master II
Master II

one dimension as hour on ur x-axis

and two expressions

one for number of people who arrive to the hospital by hour

second for number of people who leave the hospital by hour

inescastelhano
Partner - Creator II
Partner - Creator II
Author

Thank you seems like something I could use. I will try to understand it.

inescastelhano
Partner - Creator II
Partner - Creator II
Author

Sorry, The example I provided was not correct. Here follows the correct one.

Anonymous
Not applicable

Inês

See Attached.

I did a Binary Load off your qvw to rejig your data model.

inescastelhano
Partner - Creator II
Partner - Creator II
Author

Took me a bit to understand, but it works ! Thank you!