Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Let me set the stage here:
I have data measures where each measure is a different year (only two years actually, current year and prior year). with some help from a previous post i was able to get the chart date format to show only month-day (Jan-1, etc). however my problem now is that the chart, even though the year does not show from the dimension is still registering it there, so even though the Dimensions says Jan-1, Jan-2, etc it still reads it as Jan-1-2023. Because of this the two measures instead of overlapping jan 2023 and jan 2024 it is still separated. See screenshot below:
I need both Januarys for both years to show together and the lines wont be separated by year. here is the information for my app:
Main Script:
Date (Dimension): Date (Formatted as 'YYYY-MM-DD')
Rev YTD (Measure):
{$<
Year={'$(=max([Year]))'},
[DateType]={'Invoiced'}
>}
RangeSum(Above(TOTAL count([Company 1 Sales]), 1, RowNo(TOTAL)))
+
RangeSum(Above(TOTAL count([Company 2 Sales]), 1, RowNo(TOTAL)))
+
RangeSum(Above(TOTAL count([Company 3 Sales]), 1, RowNo(TOTAL)))
+
RangeSum(Above(TOTAL count([Company 4 Sales]), 1, RowNo(TOTAL)))
EOY 2023 (Measure):
{$<
Year={'$(=max([Year])-1)'},
[DateType]={'Invoiced'}
>}
RangeSum(Above(TOTAL count([Company 1 Sales]), 1, RowNo(TOTAL)))
+
RangeSum(Above(TOTAL count([Company 2 Sales]), 1, RowNo(TOTAL)))
+
RangeSum(Above(TOTAL count([Company 3 Sales]), 1, RowNo(TOTAL)))
+
RangeSum(Above(TOTAL count([Company 4 Sales]), 1, RowNo(TOTAL)))
Turns out the fix was, in the dimension expression, i did:
=Date(MakeDate(Year(Today())-1,Month,Day), 'MMM-D')
for some reason combined with having:
SET DateFormat='MMM-D';
in the Load script main combined everything correctly.
Good morning,
Create a field Month in your script (function Month), listing the month of the date, without its year. Add this field as dimension in your chart.
Enjoy your Qlik.
Kind regards,
Théo ATRAGIE.
i have a field called month and it does just that. however i still want the chart to display in daily format with 'MMM-D'.
Create the field MonthDay in your script.
Try this :
Month(Date) & '-' & Day(Date) as MonthDay
Set this field in dimension of your chart.
Enjoy your Qlik.
Kind regards,
Théo ATRAGIE.
looks like things are still separated by year
Turns out the fix was, in the dimension expression, i did:
=Date(MakeDate(Year(Today())-1,Month,Day), 'MMM-D')
for some reason combined with having:
SET DateFormat='MMM-D';
in the Load script main combined everything correctly.