Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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.

kfoudhaily
Partner - Creator III
Partner - Creator III

Hello, please try this;

sum(

        {$<

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

        Company.Name={'Abc'}

        >}

        [Value]

        )

QlikView Qlik Sense consultant
arunqlik2view
Creator
Creator
Author

works perfectly , thank you so much

arunqlik2view
Creator
Creator
Author

thanks for the reply