# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor

## Hi Qlik... i have a scenario

Hi, Qlik sense i want detach the chart, i have filers like year and month, quarter... in chart i have previous and current years sales,

here my question is that if i made any selection the previous and current years sales doesn't reflect.

kindly help me

1 Solution

Accepted Solutions
MVP

## Re: Hi Qlik... i have a scenario

Use it {1} in Max(Year) as well

Sum({1<Year= {\$(=max({1}Year)-2)}>} [POS price inclusive tax])

9 Replies
Contributor III

## Re: Hi Qlik... i have a scenario

You have to nullify your year field in the Chart while writing set.

For more clarity please post some example qvf file.

Thanks,

MVP

## Re: Hi Qlik... i have a scenario

In your expression for Current Year Sales and Previous Year sales {1}

Sum({1<Year={2017}>} Sales) like this.

Contributor

## Re: Hi Qlik... i have a scenario

Hi celambarasan,

your answer seems to correct but the year is not static, i want display year is dynamic

Sum({1<Year= {\$(=max(Year)-2)}>} [POS price inclusive tax]),

if year is dynamic, not getting my desire answer.

Thank you

MVP

## Re: Hi Qlik... i have a scenario

Use it {1} in Max(Year) as well

Sum({1<Year= {\$(=max({1}Year)-2)}>} [POS price inclusive tax])

Contributor

## Re: Hi Qlik... i have a scenario

Sounds Great....

Thank you so much.....

Esteemed Contributor

## Re: Hi Qlik... i have a scenario

try putting the expression btw " " :

Sum({1<Year= {"\$(=max(Year)-2)"}>} [POS price inclusive tax])

Contributor

## Re: Hi Qlik... i have a scenario

Hi celambarasan,

i have one doubt same scenario... which means i have filters like years, quarter, month, week... when i made selection from filters that current and previous sales chart should not reflect.. but i have some other filters like products and categories and region.... when i made selection from products and category the chart should be reflect... how can i achive this.....

Can you help me

Esteemed Contributor

## Re: Hi Qlik... i have a scenario

Let's assume, this worked fine for you:

Sum({1<Year= {\$(=max({1}Year)-2)}>} [POS price inclusive tax])

But now, you only want to prevent your expression from changing when you filter by years, quarter, month, week?

Sum({1<Year= {\$(=max({<Year=,Quarter=,Month=,Week=>}Year)-2)}>} [POS price inclusive tax])

MVP

## Re: Hi Qlik... i have a scenario

Hi,

Fields that you want to exclude selections then keep those fields in set analysis as "FieldName=" and remove 1 @ the beginning of set analysis

Sum({<Year= {\$(=max({1}Year)-2)}, Month=,Quarter=,Week=>} [POS price inclusive tax])