Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Detect, count, chart text field differences between months

My data looks like this...

Year
Month
Year_Month
Emp_ID
YR_MO_EID_Key
Business Unit
2011

12

201112

1001

2011121001ENT

2011

1220111210022011121002SMB
2012120120110012012011001ENT
2012120120110022012011002FND
2012120120110032012011002ENT
2012220120210012012021001SMB
2012220120210022012021002FND
2012220120210032012021003SMB

...and I want to make a bar chart that shows the number of employees that have transferred into a business unit by month.  A table of this output would look like this...

Month
ENTSMB
FND
DEC-11---
JAN-12001
FEB-12020

The first row is empty because there is no data prior to DEC-11.  Also, note that a new employee (1003) appears in JAN-12.  This new employee should not count as a transfer into a business unit.  If an employee stays in a business unit, that also should not count as a transfer into that business unit.  For a given month and for a given business unit, I only want to count the number of employees that a) existed in the previous month and b) changed business units to the given business unit.  How can I do this and put the monthly numbers in a bar chart?

1 Reply
CELAMBARASAN
Partner - Champion
Partner - Champion

You need to create a field in the load script as a flag whether the employee is trasferred or not.

like

Load *, if(peek('Emp_ID') = Emp_ID and peek('BusinessUnit') <> BusinessUnit , 1, 0) AS IsTransferred;

Load

Year,Month,Year_Month,Emp_ID,YR_MO_EID_Key,BusinessUnit

From ...

Order by Year_Month,Emp_ID;

Then expression as

Sum(IsTransferred)