# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Contributor

## Invalid dimension error in filter

Hi All, I am using the following expression on one of my dimension in filter, and it is throwing an error -Invalid dimension. Formulae:

if(Sum([Equivalent Total Sale Quantity])>=sum(total [Equivalent Total Sale Quantity])/COUNT(total DISTINCT [Territory Name]),

if((sum([Total Volume]*[Sales Current Month])-sum([Total Volume]*[Sales Previous Month]))/sum([Total Volume]*[Sales Previous Month])>=0,'R','G'),

if((sum([Total Volume]*[Sales Current Month])-sum([Total Volume]*[Sales Previous Month]))/sum([Total Volume]*[Sales Previous Month])>=0,'Y','B'))

Please let me know where am I going wrong.

Thanks,

Best Regards,

1 Solution

Accepted Solutions
Highlighted MVP

## Re: Invalid dimension error in filter

May be this

Aggr(

if(Sum([Equivalent Total Sale Quantity])>=sum(total [Equivalent Total Sale Quantity])/COUNT(total DISTINCT [Territory Name]),

if((sum([Total Volume]*[Sales Current Month])-sum([Total Volume]*[Sales Previous Month]))/sum([Total Volume]*[Sales Previous Month])>=0,'R','G'),

if((sum([Total Volume]*[Sales Current Month])-sum([Total Volume]*[Sales Previous Month]))/sum([Total Volume]*[Sales Previous Month])>=0,'Y','B')),

[Territory Name])

6 Replies MVP

## Re: Invalid dimension error in filter

You can use If(Aggr(Sum, Field) ....., If(Aggr(..... then only Calculated condition works

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted MVP

## Re: Invalid dimension error in filter

May be this

Aggr(

if(Sum([Equivalent Total Sale Quantity])>=sum(total [Equivalent Total Sale Quantity])/COUNT(total DISTINCT [Territory Name]),

if((sum([Total Volume]*[Sales Current Month])-sum([Total Volume]*[Sales Previous Month]))/sum([Total Volume]*[Sales Previous Month])>=0,'R','G'),

if((sum([Total Volume]*[Sales Current Month])-sum([Total Volume]*[Sales Previous Month]))/sum([Total Volume]*[Sales Previous Month])>=0,'Y','B')),

[Territory Name])

Highlighted
Contributor

## Re: Invalid dimension error in filter

Thanks a lot. This works fine. Highlighted
Contributor

## Re: Invalid dimension error in filter

Now the problem I am facing is that the average(sum(total [Equivalent Total Sale Quantity])/COUNT(total DISTINCT [Territory Name]) changes once the filter is applied. This ends up in a way that the filter shows multiple selections even if I select one. Please help.

Thanks,

Highlighted MVP

## Re: Invalid dimension error in filter

May be ignore selection using set analysis? I am not fully sure what you are trying to do, to give you a specific expression... but if you can share a sample, I might be able to help

Highlighted
Contributor

## Re: Invalid dimension error in filter

Thanks, I am new to Qlik Sense and wasn't familiar with set analysis. It is helpful and solved my problem. Thanks.