Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
bskemp01
Contributor III
Contributor III

Combo Chart Lines

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:

bskemp01_0-1708611452537.png

 

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:

bskemp01_1-1708611561165.png

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)))

 

 

 

1 Solution

Accepted Solutions
bskemp01
Contributor III
Contributor III
Author

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.

bskemp01_0-1708695477427.png

 

View solution in original post

5 Replies
theoat
Partner - Creator III
Partner - Creator III

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.

bskemp01
Contributor III
Contributor III
Author

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'. 

theoat
Partner - Creator III
Partner - Creator III

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.

bskemp01
Contributor III
Contributor III
Author

looks like things are still separated by year

bskemp01_0-1708616145445.png

 

bskemp01
Contributor III
Contributor III
Author

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.

bskemp01_0-1708695477427.png