community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Iteration on set of column in Alteryx

Hi ,

 

I have some n number of varibles in my dataset in the form:

loan_accounts.0.account_type
loan_accounts.0.actualpaymentamount
loan_accounts.0.amountoverdue
loan_accounts.0.cashlimit
loan_accounts.1.account_type
loan_accounts.1.actualpaymentamount
loan_accounts.1.amountoverdue
loan_accounts.1.cashlimit
loan_accounts.2.account_type
loan_accounts.2.actualpaymentamount
loan_accounts.2.amountoverdue
loan_accounts.2.cashlimit

 

i have calculated val using formua tool where

val= loan_accounts.0.actualpaymentamount- loan_accounts.0.amountoverdue

 

need to perform this operation on all set of varibles iteratively. How i can implement it in alteryx workflow.

 

Alteryx
Alteryx

You could do this with a MultiRow however the best way would be to get it into a table format.

 

Text2Col on '.' and then Crosstab

Highlighted

Hi , I think this wont solve my problem as my input set is in attached format and i have to iterate over some set of varibles

say datediff=loan_accounts_0_paymenthistorystartdate-loan_accounts_0_paymenthistoryenddate;

n number of times where n is number of column in table. That means i need loopover certain part of workflow.

 

In general coding language i can do it using for loop but here in alteryx I am not able to figure out how to implement it.

Alteryx
Alteryx

OK, those 2 datasets are very different. The data in the first post looks like standard JSON, however the data in the CSV looks like that has just been Cross-tabbed.

 

To answer the question you asked in the first post, you could do a for loop by way of a Batch Macro, however it is by far not the quickest method here. If you could guarantee that there was the same amount of sections in each record number, then a Multi-row formula would work, but possibly not the quickest and far from elegant.

 

As I indicated previously, splitting the Name on the point would then allow you to crosstab. You can then perform as many calcs as you would like.

 

In the attached, I have shown splitting from the first dataset (I manually added a value column), and also how I would deal with the data in the second dataset, however hopefully that's not what you're getting as it has duplication and errors in it.

Labels