Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Simple Formula Help

  1. #1
    Join Date
    Jul 2013
    Posts
    3

    Question Simple Formula Help

    Hello all,

    This is a very newbie question, but I'm trying to create what I would think is a very simple formula to return the name of the current month.

    When I create a date/time field with the value of either =Today() or =Now(), I return data without trouble.

    However, if I try =Month(Now=()) I get no syntax errors, but also no data.
    Of course =Monthname(Now=()) fails with the same result.

    Any ideas?

  2. #2
    Join Date
    Apr 2008
    Posts
    4,690

    Default

    Did you try:
    =Month(Now())
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

  3. #3
    Join Date
    Nov 2009
    Posts
    688

    Default

    Try =month(now().

  4. #4
    Join Date
    Jul 2013
    Posts
    3

    Default

    Quote Originally Posted by gutlez View Post
    Did you try:
    =Month(Now())
    Fantastic, this worked.

    I could have sworn that's what I was doing before, but apparently I was missing something. Thanks so much!

    Is there any way to return the name of that month that it returns?
    In other reporting software I've used, its just =MonthName, or something similar.

    Using =MonthNamme(Now()) doesn't give me an error, but it also returns no data.
    Last edited by Nbenson; 07-19-2013 at 04:12 PM.

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

    Default

    Instead of MONTH(NOW()) use a date field with the format string "MMM" (and use "report.date" as field, it is the same as NOW() but safes you from writing the formula).
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  6. #6
    Join Date
    Jul 2013
    Posts
    3

    Default

    Awesome, that worked perfectly, thank you all so much!!!

Tags for this Thread

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.