Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
arunqlik2view
Creator
Creator

Set analysis for Previous Year sales for a particular company

Hello All,

I'm trying to create a comparison bar chart in qlikview , where it shows the sales between two years, selected year and previous year.

I was able to create the chart for all companies but when I tried to filter the chart to a particular company , I have issue .

This is the First primary expression for the selected year for the company "Abc" - Works fine

sum({<Company.Name={'Abc'}>}[Value])


This is the Second primary expression for the previous year for the company "Abc" -  Have Issue Here


Sum({$<Year={$(=max(Year)-1)}>}{<Company.Name={'Abc'}>}[Value])

also tried from this website https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/ but no luck with it either.

Please advice on this regard.

Expected output look. ---

Screenshot_3.bmp

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

=Sum({$<Year={$(=max(Year)-1)} , Company.Name={'Abc'}>}[Value])

If this doesn't work, try to share your sample qvw.

View solution in original post

4 Replies
tresesco
MVP
MVP

Try like:

=Sum({$<Year={$(=max(Year)-1)} , Company.Name={'Abc'}>}[Value])

If this doesn't work, try to share your sample qvw.

View solution in original post

kfoudhaily
Creator III
Creator III

Hello, please try this;

sum(

        {$<

        Year={"$(=max(Year)-1)"},

        Company.Name={'Abc'}

        >}

        [Value]

        )

arunqlik2view
Creator
Creator
Author

works perfectly , thank you so much

arunqlik2view
Creator
Creator
Author

thanks for the reply