Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
willstracy
Contributor
Contributor

Hello Qlik Sense colleagues - Month Year format

ANY Hello,

I am trying to get a month year format here into my script with no luck - any help is greatly appreciated.

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='$#,##0.00;-$#,##0.00';

SET TimeFormat='h:mm TT';

SET DateFormat='DD/MMM/YYYY';

SET TimestampFormat='DD/MMM/YYYY h:mm[.fff] TT';

SET FirstWeekDay=6;

SET BrokenWeeks=1;

SET ReferenceDay=0;

SET FirstMonthOfYear=1;

SET CollationLocale='en-AU';

SET CreateSearchIndexOnReload=1;

SET MonthNames='Jan.;Feb.;Mar.;Apr.;May;Jun.;Jul.;Aug.;Sep.;Oct.;Nov.;Dec.';

SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

SET DayNames='Mon.;Tue.;Wed.;Thu.;Fri.;Sat.;Sun.';

SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

LOAD

    //"Arrival Date",

    Weekday("Arrival Date"),

    Date (makedate("Arrival Date"), 'YYYY') as ArrivalYear,

    Date (makedate ("Arrival Date"),'MMM') as ArrivalMonth,

    //Date(makedate("Arrival Date"),'MMM-YYYY') as MonthYear,

    "Arrival Time",

    //"Arrival Month Year",

    UniqueID,

    Hospital,

    ArrivalCode,

    ArrivalDesc,

    PatPostCode,

    PatSuburb,

    "Age",

    ED_DepartureStatusDesc

FROM [lib://AttachedFiles/De-identified data (002).xlsx]

(ooxml, embedded labels, table is Sheet1);

4 Replies
Chanty4u
MVP
MVP

try this

Date(monthstart(("Arrival Date"), 'MMM-YY')  as MonthYear

Chanty4u
MVP
MVP

Date(monthstart(("Arrival Date"), 'MMM-YYYY')  as MonthYear


or


date(MonthStart(date#(Datefield,'DD/MM/YYYY')),'MMM-YYYY')   as MonthYear



Note: DD/MM/YYYY   this you need to give your datefield format

Thiago_Justen_

There is a function that could do this:

MonthName (datefield) as MonthYear

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
william_fu
Creator II
Creator II

How is your date field originally formatted?

Try the syntax below, taken from the built in autocalendar:

Dual(Year("Arrival Date")&'-'&Month("Arrival Date"), Monthstart("Arrival Date")) AS [ArrivalYearMonth]