Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Iterative macro; getting the macro to function properly

Greenlama254
8 - Asteroid

Hi all,

 

I have been relatively new to the Alteryx Universe and macros especially. 

 

The attached macros (and especially the data) are just for testing purposes, the one I want to generate are complete letters with varying bank details and such, but the idea I want should be clear; for every line I want to feed the macro a separate and complicated report should be generated.

 

The thing is; the macro 1.39 is giving the desired output, but as soon as I add another report detail to the macro (1.391)  it starts leaving out information. What am I missing here?

 

Thanks in advance for any help!

 

Regards,

11 REPLIES 11
gawa
16 - Nebula
16 - Nebula

@Greenlama254 

Can you attach snapshot of error or some trouble you face? Or, can you share .yxzp package? (option->export workflow)

As I run the above Macros, it seems fine except for non valid file path.

Greenlama254
8 - Asteroid

Thanks for your quick reply. 

I noticed that indeed both seem to be working fine now, since I placed the additional report text (15) tool later in the flow to be added.

Before I added that specific tool earlier in the report part and then the output just gave me one of the report tools. 

 

Still, I do not know what was causing that and the actual report I have built is also coming out wrong with the data.. so I feel I am missing something here. 

 

But I guess that is not enough for you to go on, so I need some more time to figure out what the actual problem is. I cannot share the actual data and flow due to policy restrictions. 

 

Thanks again 

gawa
16 - Nebula
16 - Nebula

hi @Greenlama254 

I think I found the reason. You try to output pdf files based on field "Layout", but actually field "Layout" does not have any information. That's why in ver1.391 output blank pdf files.

I'm not figuring out what your task is, but I can advise you to configure Layout tool properly.

For example, be sure to include all necessary report data in Layout tool config window, while in your macro 1.391 some are unchecked/missed.

Also, I advise you to put Browser tool to Reporting tools so you see how created report looks like as intended.

 

I attach the revised workflow with dummy image data. It might be not exactly what you want, but you can reference for what I mean to say. Good luck! 

image.png

 

Greenlama254
8 - Asteroid

okay @gawa 

thanks for pointing out that the whole layout part was sloppy. Somehow a lot of the check boxes were unchecked.

 

Please see attached an example of what I am trying to achieve here. 

Basically, for every line of input I want to generate a separate PDF file. So far I cannot get the macro to function properly. Only the last line of input is taken to generate a letter but I want every line to be processed separately, so the other 9 lines as well, so that I end up with 10 separate pdf letters in this example. 

 

thanks in advance

Regards,

Roger

 

gawa
16 - Nebula
16 - Nebula

hi @Greenlama254 Glad to hear that you made progress on it.

OK so next, you want to output 10 separate report for each line, but your WF just output one PDF file. It might have something wrong in Filter tool configuration. See the below snapshot. You configured expression as "[Record ID]=[Max RecordID]" which passes only one record at last row to true anchor, and the rest 10 rows go to False anchor. As only one record come, only one repot is there, This is the reason you get only one report.

If my understanding is correct, configuration should be [Record ID]!=1 so that you filter out the first row, and pass the rest to true anchors, then you can get 10 separate reports. 

For your reference, I attach WF. Please check it out this is match to your demand.

image.png

Greenlama254
8 - Asteroid

Thanks again @gawa 

 

We are getting closer, but it's still not quite there.

In your solution the first letter (Claim2) generates the letter with ALL of the data output in it and all other 9 letters only contain text and no data. 

 

So my flow generated only 1 letter, but it was correct. It contained only the data belonging to the last line in the flow.  Except it also had to generate this similar letter for all other 9 lines of data.

 

Your solution generated 10 letters, which is what I want, but all the data from the flow is shown in the first letter, all other 9 just contain text from the reporting tools.

 

So I need to find a way to combine these solutions.

I hope I put it clearly enough.

Thanks again for your help

 

Regards,

Roger

gawa
16 - Nebula
16 - Nebula

@Greenlama254 

First of all, I apologize for not having the exact solution. I regret to say that reviewing the entire workflow would exceed the effort what I can do in this community discussion. To advise more specifically, It needs understanding on your data, its context, and goal of your task, but I cannot perfectly do that. I'm sorry about it, I guess I end up here.

Greenlama254
8 - Asteroid

@gawa 
thanks for your effort anyway, I appreciate it. 

Understanding the data is irrelevant. It is jibberish anyway.

 

Basic thing is that I want to generate a pdf report for each record that is in the input data. Every record should be processed separately. There are 10 lines in my input data, so there should be 10 separate reports, each covering 1 single record of the input.

 

Pretty sure that the set up of my iteration (attached) is not correct, so I need to dive into the basics of an iterative macro again I think.

 

Again: thank you for your help!

Regards,

Roger

gawa
16 - Nebula
16 - Nebula

@Greenlama254  OK...I got closer to issue, I guess

In your case, iterative macro may be not the one, instead you can try Batch macro.

Iterative macro repeatedly read output data of each iteration loop as input for next iteration.

On the other hand, Batch macro process data one by one, and "one through" process for each record. 

 

Anyway  I look into your WF, and I understand this Iterative macro process data one record for each iteration, and the rest of records go to F anchor of Filter tool and they will be next iteration input. Can you confirm to specify Iteration Input to Input48, otherwise this macro would not work.

 image.png

 

Labels