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: 
New-Qlik
Creator III
Creator III

bar chart last four year data

Hi I am trying to display last four year sales in bar chart.What is wrong with the expression. Please guide

Sum({$<Year = {'<=$(=Max(Year )) >=$(=Max(Year )-3) '}>} sales)

1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

maybe this:

=Sum( {< Year = {"<=$(=Max(Year))>=$(=Max(Year)-3)"} >} sales )

View solution in original post

4 Replies
agigliotti
Partner - Champion
Partner - Champion

maybe this:

=Sum( {< Year = {"<=$(=Max(Year))>=$(=Max(Year)-3)"} >} sales )

OmarBenSalem

in a set expression, if we wanna work with the year 2016 for example which is numeric: we call it without quotes:

Year={2016}

If we wanna focus on a country, Tunisia for example which is a string: we call it with quotes

Country={'Tunisia'}

In our case, we focusing on a range of dates created by an expression, so we surround it by double quotes:

Sum( {< Year = {"<=$(=Max(Year))>=$(=Max(Year)-3)"} >} sales )


shiveshsingh
Master
Master

Try with double quotes, then your string will be evaluated.

Anonymous
Not applicable

Hi Avneet,

Try below,

=Sum({<Year={">=$(=yearstart(Max(Year),-3)) <=$(=Date(Max(Year)))"}>} Sales )