Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

concate a string with an unknown number of rows

mathias_schnoor
11 - Bolide

Hey !


I want concate a urlstring with an unknown number of rows from two different data input tools.

 

Example:
First data_source one row

RecordIdFirstdatasource a      b   

1             50  480

Second data-source N rows

RecordIdSecondDataSource,  f, g

1    9.48577    53.95809
2    9.54651    53.89993
3    9.50688    53.97195
...

Pseudo code (like java):

String myurl:= "myurlstring?";

String x:= 50;
String y:= 480;
StringBuffer sb = new StengBuller();
sb.append(myurl);

for(int i=0; i< SecondDataSource.size; i++)
{
   sb.append("foo");
    sb.append(i);
    sb.append("="+x);


   sb.append("&bah");
    sb.append(i);
    sb.append("="+y);


  sb.append("&myattribute");
    sb.append(i);
     sb.append(=SecondDataSource.at(i).g);
   sb.append(",");

    sb.append(=SecondDataSource.at(i).f) ;
...
}

Result string:
myurl?foo1=50&bah1=480&myattribute1=9.48577, 53.95809&&foo2=50&bah2=480&myattribute2=9.54651,53.89993&foo3=..&bah3=..&myattribute=.., ..

Is that possible to build in Alteryx?

Mathias

5 REPLIES 5
chris_love
12 - Quasar
Use an Append Tool to attach the two strings together, then use a Formula
Tool to add the lat / lon items to the base and do the concatenation.

If you need more details on the exact formula let us know. The only
difficulty will be in the use of the "+" symbol to add and concatenate. So
the exact syntax will be dependent on your data types.

Chris
mathias_schnoor
11 - Bolide

Hey Chris,

 

thank you for your support:

I have try to build.

But how concate one myurl with the other six result (result3) rows. Any row is in the  result set at the same count.

 

appendurlwithattributes.PNG

 

I need the column one one time.

 

appendurlwithattributes.PNG

 

This what a looking for is:

 

http://myurl?sb1=k&op1=20&a1=53.97195,9.50688&sb2=k&op2=20&a2=53.95809,9.48577&sb3=k&op3=20&a3=53.89993,9.54651&sb4=k&op4=20&a4=53.97822,9.49993...

I don' t know how to build in Alteryx? How is my understanding problem?

 

Mathias

 

 

chris_love
12 - Quasar

Ah sorry one last step I missed is to summarize the parameters using Summarize tool and Concatenate result3 (see 1 in image) options.

 

Notice in Concatenate option in Summarize you can set the delimiter to "&" as you need (see 2 in image).

 

2015-11-02_10-52-32.jpg

 

You'll probably want to also take the group by myURL field too to preserver that... 

 

Chris

mathias_schnoor
11 - Bolide

Hey Chris,

 

O.K thank you for your support.

 

Finaly I have connect the Summarize Tool and the urlstring to a Join-Tool an conacte the two fields with a Formula Tool.

It works!

 

Mathias

 

chris_love
12 - Quasar
Great news, glad it worked. I love that concatenate feature in Summarize!
Labels