Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Simple vector math in Alteryx

KaiLarsen
9 - Comet

Hi colleagues,

 

I have a large set of vectors pairs, each 500 long.  For example:

VId,   Dim001,   Dim002,   Dim003.... Dim500

1,     0.500     0.200     -0.500    1.100

2,     0.200     0.400     -0.300   -1.000

3,     0.100     0.100      0.100    0.200

And do on for a few hundred thousands of rows.

 

I would like to figure out the absolute difference between rows 1/2, 3/4, etc.  For example, I would expect the following outcome:

VId,   Dim001,   Dim002,   Dim003.... Dim500

1/2,   0.300     0.200,    0.200..... 2.000

 

I could also easily pass the data in as the two vectors to be compared being on the same row.  

 

Thoughts?  Do I need to drop into R, or is there a clever way to get Altyerx working for this problem?

 

Kai :-)

   

2 REPLIES 2
jdunkerley79
ACE Emeritus
ACE Emeritus

My thought would be:

 

2018-12-28_22-10-46.png

 

First to transpose the dataset.

You can then define the calculation in a text input

A couple of joins and then a crosstab to produce the output

 

I expect would be pretty quick at scale you described

KaiLarsen
9 - Comet

Wow...I forgot the basic rule of Alteryx: Is something is too complex, just break it down into pieces.

 

Thank you!  Will test this out later today and confirm!

 

Kai :-)

Labels