Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I link 2 datefields?

Hi there, i am a quite a QV newbie, just starting to make my new dashboards. But now I have a problem:

I have 2 queries, and i want to keep them separated (no joins in the query preferably)

  • 1 query is for new customers
  • 1 query is for new subscribers (when you are a customers, you are no subscriber)
  • I have 3 countries, DE, PL and IE.

I have a dashboard (see image on the bottom). On the left I have monthnumbers, but I want them to connect.

When i click on 12 in the upper field, I also want the 12 in the bottom field to be selected. Or perhaps have them in one field!

Is this possible?

Another problem i have when i want to combine the 2 graphs, i use

sum(if(monthcust=monthsub,customers+subscribers))/3.

The 3 on the end is to get the right results (3 countries), a bit stupid but it works.

I would rather have it stacked by the way, now its 1 blue graph, but I prefer email onlies and customers to be separated but in 1 graph..

Possible as well? thanks!

Ps. these are my queries:

#subscribers

SELECT

  MONTH(s.added) AS monthsub,

  dicsub.iso2 AS countrysub,

  SUM(CASE WHEN (s.customer_id=0) THEN 1 ELSE 0 END) AS subscribers

FROM subscriber s

  JOIN variant v

    ON v.id = s.variant_id

  JOIN dic_country dicsub

    ON dicsub.id = v.country_id

GROUP BY MONTH(s.added),dicsub.id;

# customers

SELECT

  MONTH(c.date_register) AS monthcust,

  diccust.iso2 AS countrycust,

  COUNT(c.id)  AS customers

FROM customer c

  JOIN dic_country diccust

    ON diccust.id = c.id_country

GROUP BY MONTH(c.date_register),diccust.id;

qv.jpg

1 Solution

Accepted Solutions
Not applicable
Author

make their alias the same name so instead of monthsub and monthcust call them monthconcat both

Then they will link to each other, and then i think they would refer to each other.. try that.

and then select monthconcat to the left instead and use monthconcat as dimensions in your charts instead

View solution in original post

2 Replies
Not applicable
Author

make their alias the same name so instead of monthsub and monthcust call them monthconcat both

Then they will link to each other, and then i think they would refer to each other.. try that.

and then select monthconcat to the left instead and use monthconcat as dimensions in your charts instead

Not applicable
Author

Thanks! works great