Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

willstracy
New 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
sureshqv
Esteemed Contributor III

Re: Hello Qlik Sense colleagues - Month Year format

try this

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

sureshqv
Esteemed Contributor III

Re: Hello Qlik Sense colleagues - Month Year format

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
Valued Contributor III

Re: Hello Qlik Sense colleagues - Month Year format

There is a function that could do this:

MonthName (datefield) as MonthYear

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
williamfuu
Contributor II

Re: Hello Qlik Sense colleagues - Month Year format

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]

Community Browser