Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

matrix multiplication in qlikview - how ?

Hi All,

I am trying to do a matrix mulitplication of a m.p matrix(table) with a p.n matrix(table) and have a resultant m.n matrix (table).

As an example - let's say table - share prices - is loaded to qlikview from a csv/excel spreadsheet with the following values

date\company Exxon Mobil BP

1/2/11 10 20 30

2/2/11 30 60 90

3/2/11 20 40 60

We have a table - portfolio - which is kept simple and is as follows.

Company\Portfolio P1 P2

Exxon 0.3 0.5

Mobil 0.2 0.4

BP 0.5 0.1

We are trying to get a cross product of Portfolio value by doing a matrix multiplying of table 1(share prices) with table 2(portfolio). The values would be

date\portfolio val val1 val2

1/2/11 (10*0.3)+(20*0.2)+(30*0.5)=22 (10*0.5)+(20*0.4)+(30*0.1)=16

2/2/11 (30*0.3)+(60*0.2)+(90*0.5)=66 (30*0.5)+(60*0.4)+(90*0.1)=48

3/2/11 (20*0.3)+(40*0.2)+(60*0.5)=44 (20*0.5)+(40*0.4)+(60*0.1)=32

We would most appreciate if anyone would advise how this could be achieved in qlikview. Many thanks in advance.

2 Replies
Miguel_Angel_Baeyens

Hello,

Attached is an example on how to get that. First, seeing the data you have, I've done a crosstable load, resulting on having a value for each portfolio and company. Then a pivot table with the different dimensions, pivoting to horizontal the Portfolio returns something similar to what you are looking for.

Hope that helps.

imsushantjain
Partner - Creator
Partner - Creator

Any update regarding the same?