Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

vangurideepu
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

Thanks in advance

Pradeep

1 Solution

Accepted Solutions

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
jayaseelan
Contributor III

Re: Hi Qlik... i have a scenario

Hi Pradeep,

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

            For more clarity please post some example qvf file. 

Thanks,

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.

vangurideepu
Contributor

Re: Hi Qlik... i have a scenario

Hi celambarasan,

Thank you for quick reply...

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

Pradeep

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])

vangurideepu
Contributor

Re: Hi Qlik... i have a scenario

Sounds Great....

Thank you so much.....

omarbensalem
Esteemed Contributor

Re: Hi Qlik... i have a scenario

try putting the expression btw " " :

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

vangurideepu
Contributor

Re: Hi Qlik... i have a scenario

Hi celambarasan,

Thank you for reply...

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

Thanks in advance

Pradeep

omarbensalem
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?


You should then adjust your expresison like this:


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





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])