Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Line Chart with Two dimensions and Two expressions

Hi,

Some information so it would be easier to understand:

Let’s say I Have 3 customers: A, B, and C

And each one has two activities he can do each day: sleep and walk (measured in hours)

I want to show a line chart with two dimensions: Date and Customer

And two expressions: The number of hours each customer slept (solid) and the number of customer each customer walked (in dashed).

When I do this, instead of plotting two lines per customer (sleep and walk) for a total of 6 lines on the screen,

I get only two lines, the total amount of sleep and walk for each day, without different lines for customers.

How can I change it?

Thanks!

9 Replies
MK_QSL
MVP
MVP

Create a Line Chart

Dimension

Date

Customer

Expression

SUM({<activity = {'sleep'}>}hours)

SUM({<activity = {'walk'}>}hours)

Not applicable
Author

Manish Kachhia, Thanks for replying, but that does not work.

You can try it for yourself with the definitions you wrote and this Inline:

LOAD * INLINE [

    Date, Customer, activity, hours

    1, 1, sleep, 10

    1, 1, walk, 5

    1, 2, sleep, 5

    1, 2, walk, 6

    2, 1, sleep, 9

    2, 1, walk, 7

    2, 2, sleep, 6

    2, 2, walk, 3

];

As soon as the second expression is added, it shows two lines for both customers combined.

Capture.PNG.png

MK_QSL
MVP
MVP

Can you let me know what exactly you want as a end result? I am unclear now from your question..

Not applicable
Author

Two lines for each customer: one solid that describes how many hours he walked each day, and one dashed describing how many hours he slept that day.

Eventually, there should be 4 lines in this particular example.

Did I explain myself better this time, or is it still unclear?

Thanks!

dinuwanbr
Creator III
Creator III

Hi,

According to my knowledge you cant use more than two dimensions in line chart.

but try to use aggr() and heck.

BR,

Dinu1

Not applicable
Author

Hi,

I'm not really familiar with the 'aggr()' function, could you elaborate?

dinuwanbr
Creator III
Creator III

Hi,

take a look at following

http://community.qlik.com/message/511028#511028

-Dinu1

dinuwanbr
Creator III
Creator III

Not applicable
Author

Tharindu Dinuwan,

Thanks for your quick response, I read about 'aggr' but I still don't get how using it will help me.