Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kkarlste
Contributor II
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
thevingo
Creator
Creator

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)

kkarlste
Contributor II
Contributor II
Author

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)

sewialwork
Partner - Contributor III
Partner - Contributor III

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

sunny_talwar

kkarlste
Contributor II
Contributor II
Author

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

balabhaskarqlik

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)

neelamsaroha157
Specialist II
Specialist II

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)

balabhaskarqlik

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

kkarlste
Contributor II
Contributor II
Author

Correct answer