Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
mbeccaria
Contributor II
Contributor II

Multiple Date Fields, Count by Date based on Field Name

I have a client program enrollments table that, simplified, has :

ClientID, Start Date, End Date

When a client arrives, their ID is created and start date populated. When the leave, the end date is populated on the same record.

I would like to make a multi-dimension bar chart that shows the daily dates on the x axis, and 2 bars per date on the y axis. 1 bar counts the count of clients with a matching start date, the other bar a count of clients with a matching end date. Can't figure it out. The solution is illustrated in excel below. The raw data is on top, the aggregated counted data (where it counts if dates match) is below, the graph on the right is what I'm looking for. Any ideas?

mbeccaria_0-1639172310678.png

 

 

2 Replies
rubenmarin

Hi, you can use a table with a single date field and another field to filter date type, like:

Dates:
LOAD
  Client,
  [Start Date] as Date,
  'Start' as DateType
Resident [Raw Data];

Concatenate (Dates)
LOAD
  Client,
  [End Date] as Date,
  'End' as DateType
Resident [Raw Data];

With this you can create a bar chart with Date as Dimension and an expression for each DateType:

- Count({<DateType={'Start'}>} Client)

- Count({<DateType={'End'}>} Client)

mbeccaria
Contributor II
Contributor II
Author

This is a good suggestion. Unfortunately I do not have access to the build layer in Qlik Sense, just the front end report design. I work for a health care company and Qlik Sense is sold to us but the company built the backend. Is there a way to do this with the functions/set analysis/etc. tools available in the front end?