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: 
apires
Contributor
Contributor

Year and Month in the same X-axis bar chart

Hello,

Is it possible to have in the same X-Axis the average from last 4 years and the average from current year each month? Bellow a picture showing what I would like to create:

apires_1-1674148483876.png

 

Thank you!

Labels (1)
1 Solution

Accepted Solutions
MarcoWedel

one possible solution using a calculated dimension:

MarcoWedel_4-1674160119393.png

 

 

 

=Aggr(If(Year(MonthYear)<Year(Today()),Year(MonthYear),MonthYear),MonthYear)

 

 

for reference, using this data:

MarcoWedel_5-1674160150178.png

 

 

 

 

 

View solution in original post

2 Replies
MarcoWedel

one possible solution using a calculated dimension:

MarcoWedel_4-1674160119393.png

 

 

 

=Aggr(If(Year(MonthYear)<Year(Today()),Year(MonthYear),MonthYear),MonthYear)

 

 

for reference, using this data:

MarcoWedel_5-1674160150178.png

 

 

 

 

 

apires
Contributor
Contributor
Author

Hi Marco

This answer is so close from what I need, If I may ask two more questions:

1) Is it possible for currently year show all month even I don't have the numbers yet? Something close to picture bellow 

apires_1-1674218861326.png

2) I have uploaded two dummy values with 2023 date just for test, but it is showing as number not date. I don't know if makes any difference but my database is formated date like dd/mm/yyyy.

apires_0-1674218714704.png

apires_3-1674219046090.png