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

Pass parameter to Macro

LGrs
6 - Meteoroid

Hey!

 

I have been looking for a way to pass a single parameter generated in my app to a macro. I guess such a thing exists but I cannot find it even after long research ...

 

Also my macro I have been working on is kind of a tile tool, but redundant. I am not sure if there is another much simpler way to do it.

 

I try to simplify my problem: having in input records for some persons and some years (not necessarily consecutive) with data associated, and a parameter N, I want to have in rows the data of each existing N consecutive years for the same person.

 

For N=2:

 

My input 

NameYearData ...
N1Y1d11
N1Y2d12
N1Y3d13
N2Y2d22
N2Y4d24
N2Y5d25

 

My (goal) output

NameStart YearData-1 ...Data-2 ...
N1Y1d11d12
N1Y2d12d13
N2Y4d24d25

 

The problem is, N is a dynamic parameter and I don't know how to pass it to my macro.

 

Here are some pieces for my solution.

 

SequenceValid indicates if a row is a valid start for a N-sequence.

 

f1.pngf2.png

EDIT : change the annotation of image 2

I don't know what to do with the ??? yet to make it as in my example.

 

3 REPLIES 3
Joe_Mako
12 - Quasar

How about the attached macro?

 

N Year Data.png

LGrs
6 - Meteoroid

Hey Joe

 

I thank you for your answer, I did not expect to have an answer to my two questions at once!

 

I worked a bit on your solution, so that the macro works for an input with several data fields (not only one), and the output has one field per year and per data field.

 

Here is the macro, I hope it can help.

 

 

Hadzramin_Rahman
8 - Asteroid

Thanks, very useful examples

Labels