# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Rules, plus terms and conditions, can be found here.
New Contributor

## Ignore selections aggr

Hi

I have a spesific KPI that requires an aggr to get the right result:

sum({1< year = {'\$(vYear)'}, SomeDimension= {1}>} numberSomething)

/

sum({1< year = {'\$(vYear)'}>} aggr(

if(year = \$(vYear),

numberSomething)

,numberSomething,Dimension1,Dimension2,Dimension3))

But this wont ignore all selections the way i want.

Do anyone have any idea how to do this?

1 Solution

Accepted Solutions
MVP

## Re: Ignore selections aggr

May be this:

Sum({1< year = {'\$(vYear)'}, SomeDimension= {1}>} numberSomething)

/

Sum({1< year = {'\$(vYear)'}>} Aggr(

If(Only({1} year) = \$(vYear), numberSomething), numberSomething,Dimension1,Dimension2,Dimension3))

or

Sum({1< year = {'\$(vYear)'}, SomeDimension= {1}>} numberSomething)

/

Sum({1< year = {'\$(vYear)'}>} Aggr(

Only({1} If(year = \$(vYear), numberSomething)), numberSomething,Dimension1,Dimension2,Dimension3))

or

Sum({1< year = {'\$(vYear)'}, SomeDimension= {1}>} numberSomething)

/

Sum({1< year = {'\$(vYear)'}>} Aggr(

Only({1} If(Only({1} year) = \$(vYear), numberSomething)), numberSomething,Dimension1,Dimension2,Dimension3))

2 Replies
Esteemed Contributor III

MVP

## Re: Ignore selections aggr

May be this:

Sum({1< year = {'\$(vYear)'}, SomeDimension= {1}>} numberSomething)

/

Sum({1< year = {'\$(vYear)'}>} Aggr(

If(Only({1} year) = \$(vYear), numberSomething), numberSomething,Dimension1,Dimension2,Dimension3))

or

Sum({1< year = {'\$(vYear)'}, SomeDimension= {1}>} numberSomething)

/

Sum({1< year = {'\$(vYear)'}>} Aggr(

Only({1} If(year = \$(vYear), numberSomething)), numberSomething,Dimension1,Dimension2,Dimension3))

or

Sum({1< year = {'\$(vYear)'}, SomeDimension= {1}>} numberSomething)

/

Sum({1< year = {'\$(vYear)'}>} Aggr(

Only({1} If(Only({1} year) = \$(vYear), numberSomething)), numberSomething,Dimension1,Dimension2,Dimension3))