Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Kosakamaka
Contributor II
Contributor II

As-of Table not showing decreases in Metric

Hello all, I am currently attempting to make a metric that tracks employee trainings and am having a slight issue. The objective of this metric is to trend how many employees are cross trained over time. In metric there are three categories for cross trained status: one , two, and three or more product lines. In theory, as we cross train more people the "one product line" and "two product line" buckets should see a downward trend.  

To track trainings over time, I have used an As-of table to create a cumulative calendar of employee trainings. This was combined with the following set analysis to count the number of employees in a specific bucket (code below is for a single bucket):

Count({<[Employee Name] = {'=Count({<[Product Line] = {"Line A","Line B","Line C"}>} distinct [Product Line]) = 1'}>} distinct [Employee Name])

The problem that I am having is that once a decrease occurs, all prior maximum values are overridden with the new decreased value; see below for screenshot (metric has been simplified to one bucket for simplicity). 

 

Kosakamaka_0-1668455508073.png

 

Kosakamaka_1-1668455552713.png

 

When calculated manually, the metric should look like the below image:

Kosakamaka_2-1668455589874.jpeg

 

Is this issue intrinsic to using the As-of table to track dates/metrics? 

Labels (2)
2 Replies
Kosakamaka
Contributor II
Contributor II
Author

Any help would be greatly appreciated. 

oskartoivonen
Partner - Contributor III
Partner - Contributor III

Your current expression and set analysis looks at the entire data available when determining whether somebody is for example an "one product line"-person. So immediately as he's trained for another product line, he'll drop out of your entire calculation and prior months, as you noticed. The trick is to calculate each months headcount using only the data available to that month and prior months, but not future months. A cumulative calendar is typically used to achieve this functionality.