Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis help. Min and Max Date for each MonthYear in pivot table dimension.

in a pivot table, how can I get min and max date for each month considering the MonthYear dimension is added to the table.

for example:

I have a Pivot table with the following dimensions:

MonthYear

Branch

I want to get the number of active employee at the beginning and at the end of each month to calculate attrition ration.

I tried the following expression:

number of employees at the beginning of the month:

count({<event_type={A},Date={"=Min(total<MonthYear>Date)"}>} Distinct EmpID)


number of employees at the end of the month:

count({<event_type={A},Date={"=Max(total<MonthYear>Date)"}>} Distinct EmpID)

but both expression return the total number of active employees in the month which is not what I want.

below is my data model,  I create a record in Event_log table for everyday an employee is "Active"

1 Reply
maxgro
MVP
MVP

if I understand,

add 2 flag in MasterCalendar for begin and end of month;

in expression you can use the flag (set analysis) to filter

count({<event_type={A},FlagStartMonth={1}>} Distinct EmpID)