Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Matrix entries multiplication.

edgarz01
5 - Atom

I need to multiplicate two matrix, but it is not the classic multiplication, instead, it is a entry by entry multiplication, as show in the next image. It is very important to know that all matrix dimensions are nxm (always), it is generic because the imput matrixs are generate by a dynamic process, the dimensions are not always same, then I need a generic and dymanic process to solve that issue.

Untitled.png

7 REPLIES 7
FrederikE
13 - Pulsar

Hey @edgarz01,

 

My suggestion would be to transpose the matrices, so you get the following structure:

Col Row Value

1    1       a1

1    2       a2

...

 

And then you do the same thing with matrix b. 

When you have both matrices in long data form, you can use a join (on row and col) to combine them and then use a regular formula tool to do the multiplication. When done, transpose backwards and you should have your result. 

Qiu
20 - Arcturus
20 - Arcturus

@edgarz01 
It looks to be a very interesting one.
But you are saying that it is an entry by entry multiplication, so the most right-top 2 entries in the product matrix should be 

a1n * b1n

a2n * b2n?

apathetichell
18 - Pollux

assuming @Qiu is correct - record id. transpose (record id as key column). tile tool (record id as key column). join on record id/tile sequence number. multiple x*y. crosstab with record id as key columns. tile sequence as header. multiplication product as value.

 

see attached.

Qiu
20 - Arcturus
20 - Arcturus

@apathetichell 
nice work! 😁

edgarz01
5 - Atom

Nice, it a simple and accurate solution. I used the suggestion and it worked like a charm.

edgarz01
5 - Atom

@Qiu @FrederikE @apathetichell  Thank u for your solutions, I was able to solve the problem with your suggestions.

Qiu
20 - Arcturus
20 - Arcturus

@edgarz01 
Thank you for your feedback and glad to know it is solved.

Labels