Jump to content

Formatting the horizontal DATE axis in a cross table


Go to solution Solved by Stephane Forrer,

Recommended Posts

Hi, 

I have created a document property that has 4 options to choose from; 'Date' is a column that comes from a daily frequency table. 
image.png.2d66e784ac5a21099174f3dbfa4730f9.png

I use this document property as a horizontal axis in a cross table as:

<${DocumentPropertyTitle}>

When the user selects 'Monthly', the data is displayed as:

image.thumb.png.a9976da2465f2b72a69f312738a07983.png

 

Is there a way to format the months to be displayed  as :

1/1/2024  2/1/2024 3/1/2024 etc. instead of Jan Feb Mar...?

Link to comment
Share on other sites

  • 2 weeks later...
  • Solution
Posted (edited)

Hmm... it doesn't look like you can do it using the BinByDateTime function.

 

There may be a more elegant way than this but this seems to work...  rather BinByDateTime you add your own two Horizonal fields using two expressions, one for year the other for month formatted as "01/01/2024". 

image.thumb.png.5f7ddd7d91c552cb4d621338e22e0601.png

In the Property you'd need something like:

<Year([ByDate]) NEST Concatenate(If(Len(String(Integer(Month([ByDate]))))=1,"0" & String(Integer(Month([ByDate]))),String(Integer(Month([ByDate])))),"/01/",Year([ByDate]))>

 

You also need "01" in the month to order it correctly otherwise it orders it by text (1/,10/,11/,12/,2/,3/...etc. not 01/,02/,03/...)

 

Edited by Stephane Forrer
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...