Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Scenario to display sales data in between years using set analysis.

Recently I attended an interview. Below is one of the questions asked. Could any one please help me with the answer.

Suppose we have sales data for years from 2001 to 2015. If I select year 2015, the chart should display sales data for years 2010 to 2015. Similarly, If I select year 2010, the chart should display sales data for years 2005 to 2010.

How can you do that using set analysis ?

5 Replies
MVP
MVP

Re: Scenario to display sales data in between years using set analysis.

you ca use a chart with year as dimension and this expression

sum({$ <year={">=$(=max(year)-5)<=$(=max(year))"}> } sales)

Not applicable

Re: Scenario to display sales data in between years using set analysis.

Thanks Maxgro.

I believe max(year) is identical to year. Please correct me if I am wrong.

Do you think the above expression gives correct results if I select year as 2010  ?

Thanks,

Chowdary

MVP
MVP

Re: Scenario to display sales data in between years using set analysis.

small example in the attachment

2.png1.png

Not applicable

Re: Scenario to display sales data in between years using set analysis.

Thanks maxgro.

It works

MVP
MVP

Re: Scenario to display sales data in between years using set analysis.

please close the thread

Community Browser