3 Replies Latest reply: Mar 9, 2017 12:41 AM by Shraddha Gajare RSS

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

    Elise Reiter

      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.