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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Comparison of two year data in bar chart

Hello All,

I am working on Retail application. I have shown total sales of Product's category. Now What I want, When ever I selects year, It should give me comparison of selected year and previous year w.r.t to product's category.

Thanks in Advance

Regards,

Raj

6 Replies
tresesco
MVP
MVP

If you take Year as dimension, you can try expression like:

=Sum({<Year={">=(=Max(Year)-1)"}> Amount}

Or, for detailed discussion and understanding see this recent blog post: http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/03/ytd

arulsettu
Master III
Master III

hi try this. it will give last year and current year comparison

( sum( {<Year={$(=Max(Year))}>} totlasales) - sum({<Year={$(=Max(Year)-1)}>} totalsales))/sum( {<Year={$(=Max(Year)-1)}>} totalsales)

jagan
Partner - Champion III
Partner - Champion III

HI,

Try like this

Dimension = Year

Expression = Sum({<Year={">=(=Max(Year)-1)"}> Amount)

OR

= Sum({<YearDimensionName=, MonthDimensionName=, QuarterDimensionName=,

DateDimensionName{">=$(=YearStart(Max(DateDimensionName), -1))"}> Amount)

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Anonymous
Not applicable
Author

Jagan,

Its not working.

Regards,

Raj

jagan
Partner - Champion III
Partner - Champion III

Hi Balraj,

Can you attach some sample file?

Regards,

Jagan.