Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
bskemp01
Contributor III
Contributor III

Date Formatting on Combo Chart

Ok folks i need some help if possible. I am looking for a way to format Dates as Month & Day only. i.e. - (Jan-1, Jan-2, etc). I have yet to find a forum post about this so any help would be appreciated. I have tried this:

Date(MakeDate(num(SFINVY)+2000,left(num(SFINVM,'0000'),2),right(num(SFINVM,'0000'),2)),'MM-DD') as DayOfYear

*SFINVY is a two digit year from the database.

*SFINVM is the month and day (Jan 21 = '121') from the database.

and as you can see here the value is being formatted correctly:

bskemp01_0-1708523747921.png

 

 

but the format still comes out as 1/1/2024 on the chart. (See screenshot below)

The Reason: the reason i need the dates in this format is because i have a combo chart that i have multiple lines on, some for current year and some for previous and i need them to overlap based on the day of the year(for any year).

 

What i am getting:

bskemp01_0-1708523203412.png


What i need:

bskemp01_1-1708523221673.png

 

1 Solution

Accepted Solutions
theoat
Partner - Creator III
Partner - Creator III

Change the line SET DateFormat like this :
SET DateFormat = 'MMM-D';

Kind regards,
Théo ATRAGIE.

View solution in original post

11 Replies
theoat
Partner - Creator III
Partner - Creator III

Can you show me your main in the script ?
I think you will need to change this to resolve your case.

Kind regards,
Théo ATRAGIE.

bskemp01
Contributor III
Contributor III
Author

This is the main in the load script if that is what you mean:

SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;-$#,##0.00';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
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';
SET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';

bskemp01
Contributor III
Contributor III
Author

is this what you are asking for?

SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;-$#,##0.00';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
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';
SET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';

bskemp01
Contributor III
Contributor III
Author

SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;-$#,##0.00';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
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';
SET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';
bskemp01
Contributor III
Contributor III
Author

are my replies coming through? everytime i refresh the page my reply is gone.

bskemp01
Contributor III
Contributor III
Author

apparently trying to post code makes my reply disappear so heres a screenshot:

bskemp01_0-1708525082935.png

 

Bolijay00
Contributor III
Contributor III

try this Date(your date field, 'MMM-D')
Bolijay00
Contributor III
Contributor III

 this will deninately work   -     Date(your date field, 'MMM-D')

theoat
Partner - Creator III
Partner - Creator III

Bad idea, this isn't a good practice to use calculated dimension.