Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Count particular value occurrence

  1. #1
    Join Date
    May 2010
    Posts
    133

    Default Count particular value occurrence

    Hi everyone!

    I have to count workdays of an employee using functions or formula .

    User_id day_type

    004 w
    004 w
    004 wo
    004 w
    005 w
    005 w
    005 w
    005 wo


    where w stands for work days and wo for week off.
    I have achieved to count total occurrence of w and wo using group by user_id .......................

    But how to count occurrence of w for particular user for showing only workdays of an employee.

  2. #2
    Join Date
    Jan 2006
    Posts
    245

    Default

    I think you can solve your problems with a very basic sql query using group by and count sql functions.

    S.
    Follow Me on Twitter: sramazzina
    My Skype account: sramazzina
    My Blog
    View my profile on LinkedIn: http://www.linkedin.com/in/sramazzina
    Author of Pentaho Data Integration Kitchen How-To and Pentaho Business Analytics Cookbook

    Join us on IRC server Freenode.net, channel ##pentaho ##saiku

  3. #3
    Join Date
    May 2010
    Posts
    133

    Default

    I want to use this data set for further operations that's why i can't use query operation.
    I want to generate a PRD function for this operation.

  4. #4
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Add a named formula expression that filters your columns:

    =IF("day_type" == "wo"; 1; 0)

    and then simply sum on that expression with a ordinary "Running Sum" function.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  5. #5
    Join Date
    May 2010
    Posts
    133

    Default

    Thank You Taqua !

    This is working nice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.