Changing the format of Month from character('JAN','FEB',..) to integer(1,2,..) without changing the regional settings.

Changing the format of Month from character('JAN','FEB',..) to integer(1,2,..) without changing the regional settings.

book

Article ID: KB0077824

calendar_today

Updated On:

Products Versions
Spotfire Desktop All Versions

Description

By default, regional settings determine the format of output for the columns created by expressions such as Month([Date Column]). If the outcome format of the used expression for the month is like JAN,FEB, and you want to convert the string formatted month into a number like 1,2 etc., then follow the resolution steps below.

Issue/Introduction

Changing the format of Month from character('JAN','FEB',..) to integer(1,2,..) without changing the regional settings.

Environment

All Supported Operating Systems

Resolution

Follow any of the below step:

Create a calculated column by making use of the expression - LongInteger(Month([Date Column]))

OR

You can also create a calculated column by making use of the expression - Month([Date Column]).
      a). Click on the Formatting button present at the right side bottom on the same window and select Number format.
      b). If you want to display month in number (two digit) format such as '02', Click on the formatting button>>Custom & put 00 (two zero) as per the attached image. (Filename: Formatting_Month.PNG).

Attachments

Changing the format of Month from character('JAN','FEB',..) to integer(1,2,..) without changing the regional settings. get_app