Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

need to get Year from Month Name field

Hi Team,

  I am having month field like "May-2017" .Here I need to get the Previous year data. So when I use Year(Month) or any other functions in the  field I am getting numeric values something 20.2K  etc. Kindly let me know how to fix the same

6 Replies
jugrimault
Partner - Contributor III
Partner - Contributor III

Hi,

Are you sure it is a date format?

Did you try to cast it?

=year(date#([Month], 'MMM-YYYY'))

Anonymous
Not applicable
Author

Hi Jaya Prakash,

Maybe like this

Year(date(<your field name>))

Regards,

Sadasiva

Anonymous
Not applicable
Author

This is what I use to get all the months in 2017 that I have data for.

Let ProdCurrentYear= Date(Today(), 'YYYY');

Anonymous
Not applicable
Author

Hi Jaya Prakash,

We have an option to change the format of the expression from Auto to nuumber in properties->Data->Measures->Expression, this may helps.

Regards,

Sadasiva

OmarBenSalem

Just change your x-axis as follow:

uncheck continuous:

Capture.PNG

kvanandan1
Creator
Creator

Hi Jaya prakash,

I think the date is in string format, if you require the year value you can use the string function to extract the year alone.

For example right(Month,4) will give the year part alone which you can use it in your calculation.