Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Column Header Changes based on Year of today

Hi guys,

I am building a chart that has HC year of today and the next two years. The source columns on the database are 2014, 2015 and 2016. next year they will be 2015, 2016 and 2017.

Is there anyway i can refer to the current columns as [Year(Today())],[Year(Today())+1] and [Year(Today())+2]?

Thxs,

4 Replies
mphekin12
Specialist
Specialist

In the Expression tab of your chart highlight the expression you want to label then put one of the following formulas into the Label box (this box is right above the Definition box):

     year(today())

     year(today()) + 1

     year(today()) + 2

alec1982
Specialist II
Specialist II
Author

Hi,

thank you for your reply and your help. The question is in regard of the data within the expression and not on the title.

For example Sum(2014) and I am trying to find a way to save it as Sum(Year(Today())).. Let me know if you have any idea.

Best,

kedar_dandekar
Creator
Creator

Hi Alec,

Try this in the chart expression: Sum($(='[' & $(=Year(Today())) & ']'))

For the next year: Sum($(='[' & $(=Year(Today())+1) & ']'))

Refer attached example (Checkout the dynamic column expression)

HTH

kedar_dandekar
Creator
Creator

Hi Alec,

I had updated the contents of my previous post (fixed expression syntax),

Please try the updated expression, do let me know if it works for you.

HTH,

KD