Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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

Re: How to show two graphs in a line chart

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;

5 Replies
Not applicable

Re: How to show two graphs in a line chart

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

Re: How to show two graphs in a line chart

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

Re: How to show two graphs in a line chart

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;

MVP
MVP

Re: How to show two graphs in a line chart

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

Re: How to show two graphs in a line chart

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!!

Community Browser