Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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
Honored Contributor III

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

try

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

Not applicable

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

When I do that I get a count of 1

shraddha_g
Honored Contributor III

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

Share your app with sample data