Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
dpstanley_13
Contributor III
Contributor III

Date sorting in previous year comparison bar chart.

I have a chart that compares a 30 day range to the same 30 day range from the previous year.  Currently the chart looks like this:

Green = 2015

Beige = 2016

PriorYearBarChart.JPG

I really want the bars for the same month and day placed next to each other, instead of the the group of dates showing for one year and than the other.  My dimension is simply a date.  Is there an expression that I can sort on to achieve what I want, or is there another approach all together?

3 Replies
sunny_talwar

Change your dimension from date to a calculated one -> Date(Date#(SubField(DateField, '/', 1) & '/' & SubField(DateField, '/', 2), 'M/D'), 'M/D')

dpstanley_13
Contributor III
Contributor III
Author

I ended up using a similar concept without forcing it as a date, as this seems to break my set analysis.  I used Num(Month(DateField),'00')&Num(Day(DateField),'00').

Colin-Albert

Use Day(YourDateField) as your dimension instead of YourDateField.

Day gives the day of the Month (1-31)