# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

New Contributor II

## calculate dimension

Hi

have you any ideas this calculation dimension

how the script goes

if field1 = ('1','10) sum (field2 /0,85) otherwise take (field3)

if field4 = ('9225', '9153', '9161', '9122', '9104') field1 = ('1','10) sum (field2 / 0,9) otherwise take (field3)

10 Replies
Contributor

## Re: calculate dimension

If( field1 =1 or field1 =10,  sum (field2 /0.85), field3)

if ( match(field4 , '9225', '9153', '9161', '9122', '9104') and match(field1 , 1, 10),  sum (field2 / 0.9), field3)

New Contributor II

## Re: calculate dimension

This is correct

=If( Tuottovarattavat = 'x' ,  sum (Kulut /0.85), Veroton)

but this is not

if ( match( [VBAPFactKEY], '009225', '009153', '009161', '009122', '009104') and (Tuottovarattavat = 'x' , sum (Kulut / 0.9), Veroton)

Highlighted
Partner

## Re: calculate dimension

You forgot to close your sum. Try this:

if (match( [VBAPFactKEY], '009225', '009153', '009161', '009122', '009104') and (Tuottovarattavat = 'x' , sum (Kulut / 0.9)), Veroton)

AGB

MVP

## Re: calculate dimension

New Contributor II

## Re: calculate dimension

if ( match( [VBAPFactKEY], '009225', '009153', '009161', '009122', '009104') and (Tuottovarattavat = 'x' , (sum (Kulut / 0.9)), Veroton)

if you this thig (sum

bold text not works

Honored Contributor

## Re: calculate dimension

You were not closed the bracket of Tuottovarattavat='x' properly.'

Use below expression:

=if(Match([VBAPFactKEY],'009225','009153','009161','009122','009104') and (Tuottovarattavat = 'x'), Sum(Kulut/0.9),Veroton)

Valued Contributor II

## Re: calculate dimension

In order to use an aggregation function like Sum in calculated dimension, you'll need to use Aggr -

if ( match( [VBAPFactKEY], '009225', '009153', '009161', '009122', '009104') and (Tuottovarattavat = 'x' , Aggr(sum (Kulut / 0.9)), Veroton)

(Check on the number of paranthesis)

Honored Contributor

## Re: calculate dimension

=If(Match(field1,'1','10'),Sum(field2/0.85),field3)

=if(Match(field4,'9225','9153','9161','9122','9104') and Match(field1,'1','10'),Sum(field2/0.9),field3)

New Contributor II