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

How to show two graphs in a line chart

Hi All,

I'm new to qlik sense and looking for a solution on a tricky(atleast for me) situation.

Basically i have a year dimension and two ID's say Purchased ID and Registered ID. I need to display the count of Purchased ID's in one line and Count of Registered ID's in another line against the same year in a line graph.

Capture.PNG

I need to combine both the graphs on top into one....which gives me the below one. But, i need to show just two lines say GREEN line for purchased and BLUE for REGISTERED. Not like the one below which i get on selecting 2 dimensions(REG and PUR) and 1 measure(YEAR).

TIA!!

1 Solution

Accepted Solutions
Not applicable
Author

still possible, although a little changed:

[SourceTable]:

SQL

SELECT

          RegistrationID,

          RegistrationDate,

          PurchasedDate

FROM <RegistrationTable>;

[Registrations]:

LOAD

     Year(RegistrationDate) AS Year,

     RegistrationID

RESIDENT SourceTable;

[Purchases]:

LOAD

     Year(PurchasedDate) AS Year,

     RegistrationID          AS PurchasedID

RESIDENT SourceTable;

DROP TABLE SourceTable;

View solution in original post

5 Replies
Not applicable
Author

Looks like you are loading Purchased & Registered separately in your script - if you rename the Year field in both, to the same thing, Qlik will join the two tables.

You can then drop your (new) Year field as the dimension and add Count(PurchasedID) and Count(RegisteredID) as your measures - use a Combo Chart, so you can add more than one measure.

Not applicable
Author

Thanks for the response Andrew.

My bad, probably i didn't explain clearly in my original post.

Basically, i have an RegistrationID which has PurchasedDate and RegisteredDate fields against.

So, to get the count of Purchased Products in a year i do (Count(RegistrationID) ,Year(PurchasedDate))

The same way for Registered Products (Count(RegistrationID), Year(RegisteredDate)).

Best Regards.

Not applicable
Author

still possible, although a little changed:

[SourceTable]:

SQL

SELECT

          RegistrationID,

          RegistrationDate,

          PurchasedDate

FROM <RegistrationTable>;

[Registrations]:

LOAD

     Year(RegistrationDate) AS Year,

     RegistrationID

RESIDENT SourceTable;

[Purchases]:

LOAD

     Year(PurchasedDate) AS Year,

     RegistrationID          AS PurchasedID

RESIDENT SourceTable;

DROP TABLE SourceTable;

jonathandienst
Partner - Champion III
Partner - Champion III

This type of problem is solved here: Canonical Date

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks both Andrew and Jonathan.

Andrew's suggestion solved my problem and Jonathan's provided input for another case in the same scenario.

Thanks again!!