Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use count for a variable created using a mapping table?

I have used the following script to load a new variable called "RaisedByField" to indicate whether or not certain employees raised Notifications

AllNotifications:

LOAD

    "Created by" as [User Name],

    "Changed by",

    "Completn date"

EmployeeNotifications:

LOAD

    "User Name",

    "Employee Name",

    "Building Code"

MapEmployeeNotifications:

MAPPING LOAD

   [User Name],

   '1'

RESIDENT EmployeeNotifications;

New_Table:

LOAD

   [User Name],

   ApplyMap('MapEmployeeNotifications',[User Name],'0') AS RaisedByField

RESIDENT AllNotifications;

When I do a manual count of the Notifications raised by employees from the "EmployeeNotifications" table I get 9

When I use the expression: count ({<RaisedByField={'1'}>}[User Name]) or count ({<RaisedByField={'1'}>}[RaisedByField]) I get 10

Why is the mapping load not working properly? The count should be 9.

3 Replies
shraddha_g
Partner - Master III
Partner - Master III

try

count (distinct {<RaisedByField={'1'}>}[RaisedByField])

Not applicable
Author

When I do that I get a count of 1

shraddha_g
Partner - Master III
Partner - Master III

Share your app with sample data