Planning Analytics

 View Only
Expand all | Collapse all

Seeking Advice on Date and Time Display Formats

  • 1.  Seeking Advice on Date and Time Display Formats

    Posted Thu April 11, 2024 10:49 AM
    Edited by Asgeir Thorgeirsson Thu April 11, 2024 11:05 AM

    Hey everyone,

    I could use some help with date and time display formats in PAW, specifically when working with the NOW() function. Here's the situation:

    1. NOW() Function Usage: In one of my TI processes, I'm using NOW() to capture the numerical date/time and storing it in a TM1 dimension member. For example:

      ATTRPUTN(NOW, 'Import_Log', Import_Log, 'EndTimeN')
    2. Display Format Issue: Following that, I'm attempting to set the display format (within PAW) for the date and time. I've set the format for 'EndTimeN' like this: d:m/d/yyyy h:nn:ss ID|DT|S|M|Y|Y.

      Just to note, the format string includes a special character after 'h:nn:ss'. 
      However, despite this setup, I'm encountering a problem. 
      Instead of displaying something like 10.04.2024 13:52:46, I'm getting 10.04.1964 13:52:46
      when the numerical date is 23477.57831018519.

    Seeking Advice: Any suggestions on how to resolve this discrepancy in the date and time display format?

    Additional Info: I've tried consulting the IBM manual for Date and Time display formats (link), but without success. While I did receive some help experimenting with date and time display formats in the Performance Modeller, I generally don't use that product.

    I'd appreciate any insights or suggestions you might have. Thanks for your assistance!

    Cheers, Asgeir



    ------------------------------
    Asgeir Thorgeirsson
    ------------------------------



  • 2.  RE: Seeking Advice on Date and Time Display Formats

    IBM Champion
    Posted Thu April 11, 2024 11:21 AM

    The short answer is that TM1 uses 1960/01/01 as its seed whilst most other systems like Excel etc. use 1900.
    You are thus 60 years out or about 60*365.25 days when converting to a serial number.

    In terms of changing this, have a look at this UseExcelSerialDate but with history in the model, you may need to reprocess.

    You may want to look at adding the 60 years in your TI.

    Another alternative depending on how many times you need to replicate this in PAW is to use a calculated member and add the 21915 days.

    HTH



    ------------------------------
    George Tonkin
    Business Partner
    MCI Consultants
    Johannesburg
    ------------------------------



  • 3.  RE: Seeking Advice on Date and Time Display Formats

    Posted Thu April 11, 2024 01:27 PM

    Thank you @George Tonkin

    The mind-boggling part is that when you select a date with the date selector or type in a date in PAW, it is stored with the 1900 base. So you also have to subtract 21915 from the selected date if you want to work with that date in TM1 rules or a TI process. So I am saying there is a conflict within TM1/PAW because it uses both the 1900 base and the 1960 base as default. Am I right or is this a misunderstanding?

    Cheers, Asgier



    ------------------------------
    Asgeir Thorgeirsson
    ------------------------------



  • 4.  RE: Seeking Advice on Date and Time Display Formats

    IBM Champion
    Posted Fri April 12, 2024 01:21 AM

    Hi Asgeir,

    If the behaviour is different, I would suggest you log this with IBM as they may not be aware.

    The functionality should work consistently, whether it works consistently as you need it or not will be the next issue.



    ------------------------------
    George Tonkin
    Business Partner
    MCI Consultants
    Johannesburg
    ------------------------------



  • 5.  RE: Seeking Advice on Date and Time Display Formats

    Posted Fri April 12, 2024 08:49 AM

    Hi George,

    Given the fact that TM1 predates Excel I'd argue we'd have to log this with Microsoft <LOL>

    Kidding aside, it's annoyed me in the past as well but my suggestion to change this couldn't count on much support as it would potentially be breaking customers in ways we can predict (not knowing how people use it). But it is the customer that assigns a meaning to an otherwise numeric value in a cube.

    Open for suggestions to 'fix' this, short of me introducing types to tackle this once and for all ;-)

    Cheers,

    -H

    PS wouldn't mind the ticket to spike the discussion on the topic once again (and otherwise make at least support aware of this magic 21915 value, which I'm sure they'd find in more support case;-).



    ------------------------------
    Hubert Heijkers
    STSM, Program Director TM1 Functional Database Technology and OData Evangelist
    ------------------------------



  • 6.  RE: Seeking Advice on Date and Time Display Formats

    IBM Champion
    Posted Fri April 12, 2024 09:54 AM
    Edited by George Tonkin Fri April 12, 2024 09:55 AM

    Ha ha, TM1 does indeed predate Excel by a couple years!

    I thankfully have limited cases of this personally and do the necessary handling in TI.

    Using a calculated member in MDX may help Asgeir, although this would be a read-only member so does not address any selection/updates.

    The MDX could add 21915 to the value in the underlying cell and then format it.

    WITH MEMBER 
    	[_S-Assumption].[_S-Assumption].[Now plus 21915] AS 
    		[_S-Assumption].[_S-Assumption].[Current Time]+21915.0, 
    		SOLVE_ORDER = 1, FORMAT_STRING = '#,##0.00;(#,##0.00)'
    	MEMBER 
    	[_S-Assumption].[_S-Assumption].[Now plus 21915 formatted] AS 
    		[_S-Assumption].[_S-Assumption].[Current Time]+21915.0, 
    		SOLVE_ORDER = 2, FORMAT_STRING = 'yyyy\/mm\/dd' 		
    SELECT 
      {[_S-Assumption].[_S-Assumption].[Current Time], 
       [_S-Assumption].[_S-Assumption].[Now plus 21915], 
       [_S-Assumption].[_S-Assumption].[Now plus 21915 formatted]} ON 0, 
    {[_S-Assumption Measures].[_S-Assumption Measures].[ValueN]} ON 1 
    FROM [_S-Assumption] 
    WHERE ([Company Code].[Company Code].[# Company Code])

    The resultant view would be something like the below:
    I did need to update the format on PAW to "Use database format" before it actually rendered based on the MDX format.

    Also, I did not need two members, I included the "Now plus 21915" purely as an intermediate measure for clarity.

    @Asgeir Thorgeirsson - you have some options...



    ------------------------------
    George Tonkin
    Business Partner
    MCI Consultants
    Johannesburg
    ------------------------------



  • 7.  RE: Seeking Advice on Date and Time Display Formats

    Posted Mon April 15, 2024 03:25 PM

    This cfg helps, but is better if you get this setup when you start building. https://www.ibm.com/docs/en/planning-analytics/2.0.0?topic=file-useexcelserialdate



    ------------------------------
    Ryan Clapp
    ------------------------------



  • 8.  RE: Seeking Advice on Date and Time Display Formats

    Posted Mon April 15, 2024 09:33 PM

    Thanks for reminding me about that setting Ryan, forgot about that when I responded earlier. This was actually the trigger for the discussion I had internally when we were cleaning up configuration parameters in v12 but, as you can imagine, removing it and always using Excel's serial date would have broken things since there is no way for TM1 to know what numbers in a cube represent a date.

    However I'm thinking there wouldn't be anything wrong with making this setting default to true for new database going forward now would it?



    ------------------------------
    Hubert Heijkers
    STSM, Program Director TM1 Functional Database Technology and OData Evangelist
    ------------------------------



  • 9.  RE: Seeking Advice on Date and Time Display Formats

    IBM Champion
    Posted Tue April 16, 2024 04:07 AM

    For me it can be T as the default value. It is 1 (small) step less when starting a new project.



    ------------------------------
    Wim Gielis
    ------------------------------



  • 10.  RE: Seeking Advice on Date and Time Display Formats

    Posted Tue April 16, 2024 04:36 AM

    +1 For defaulting to true on use Excel Serial



    ------------------------------
    Steven Rowe
    ------------------------------



  • 11.  RE: Seeking Advice on Date and Time Display Formats

    Posted Tue April 16, 2024 10:03 AM

    I agree, defaulting to true would be good. One question though, does the v12 backup functionality also capture the config settings? If so, then changing the default is the way to go. 



    ------------------------------
    Ryan Clapp
    ------------------------------



  • 12.  RE: Seeking Advice on Date and Time Display Formats

    Posted Wed April 17, 2024 07:15 AM

    The TM1 v12 backup feature does backup all of the configuration settings.



    ------------------------------
    Stuart King
    IBM Planning Analytics Offering Manager
    ------------------------------



  • 13.  RE: Seeking Advice on Date and Time Display Formats

    IBM Champion
    Posted Tue April 16, 2024 11:20 AM

    +1 for default to True from my side - I am setting this on new models but a default would be good!

    Would also need to see how changing the default in the future impacts existing models e.g. running on PAoC where the configuration uses the defaults and is currently false. A change could have unintended consequences for some if the flag is not first written back as False.



    ------------------------------
    George Tonkin
    Business Partner
    MCI Consultants
    Johannesburg
    ------------------------------



  • 14.  RE: Seeking Advice on Date and Time Display Formats

    Posted Sat April 20, 2024 09:15 AM

    Correct George,

    We had already realized this as well which is we've decided to technically keep the default the same in the code but in the configuration for every new database you create in v12 set this parameter to true. As such there won't be any change in v11 if anybody wonders, you'd still have to set this value in the tm1s.cfg file yourself for every new database you create.



    ------------------------------
    Hubert Heijkers
    STSM, Program Director TM1 Functional Database Technology and OData Evangelist
    ------------------------------