Alteryx Designer Desktop Discussions

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

Batch Macro got the wrong output

Lichunhuang
7 - Meteor

Hi everyone,

I am using a batch macro to calculate various of data, and get the total based on the original textinput.

The correct output should be 

first row: 0

second row:1740690.34

third row:366326.97

But it shows below:

Lichunhuang_3-1633107819894.png

 

 

 

Lichunhuang_1-1633107335985.png

The workflow:

Lichunhuang_2-1633107375511.png

Parameter:

 

Lichunhuang_0-1633107282155.png

 

Thank you.

 

11 REPLIES 11
apathetichell
18 - Pollux

You first action tool isn't configured at all. You need to configure that if you want to swap out the formula via the batch macro.

Lichunhuang
7 - Meteor

Hi, can you give me more details about my first tool?

I am not sure which step you mention about.

Lichunhuang
7 - Meteor

Do you know how I can  make my formula work? 

Thank you in advance.

 

AkimasaKajitani
17 - Castor
17 - Castor

Hi @Lichunhuang 

 

You don't select the "Value or Attribute to Update". So designer can't know which attribute should be update.

 

AkimasaKajitani_0-1633163361686.png

 

Please select the attribute. I think the below is the correct.

 

AkimasaKajitani_1-1633163604423.png

 

Lichunhuang
7 - Meteor

Hi,

I have tried it again, but it didn't work. 

AkimasaKajitani
17 - Castor
17 - Castor

Hi @Lichunhuang ,

 

I rewrited the Formula tool's parameter directly within macro, but the result is not that you showed.

 

If you input these parameter into the 1st Formula tool, what expression is you expected.

 

Now is as follow expression.

if CONTAINS([AG],"CU")
then"Yes"
else "NO"
endif

 

If you Input parameter is [RW], what is that you expected?

 

 

 

DawnDuong
13 - Pulsar
13 - Pulsar

hi @Lichunhuang 

Before running the batch macro, if you run one single instance of the calculation using the standard workflow, did you get the expected results for that one instance?

 

Lichunhuang
7 - Meteor

Yes. It works for the single one, but it cannot show the right answer while running the batch macro.

Lichunhuang
7 - Meteor

The "New sumup" column([RW],[BK],ABS[BN] - [RB])), is a parameter which determine which column to use in input2

The "Right_1" column is another parameter to determine which formula to use, 

In batch marco  :

if CONTAINS([AG],"CU")
then'Yes'
else 'No'
endif

CONTAINS([AG],"CU")  should be replace by other formula in "Right_1"

for example, in text input, "new sumup" = [RW], "Right_1"= !CONTAINS([AG],"CA")  and !CONTAINS([AG],"CC")

These two parameters will be used in batch marco as formula as below:

filter column "AG" in input2 that doesn't contains "CA" and "CC", then sum up column "RW"

 

But it seem the formula cannot be replace in batch macro. 

Is it clear?

 

Labels