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

Split data into 2 streams

Hamder83
11 - Bolide

Hi 

I have a simple xlsx file, with two seperate data sets.

So basicly I need to take the first part and create one stream, and then take the 2. part as a stream and then combine them.

But im not sure how to do that with the 2. part. 

I have added a set of sample data. And highlighted the two lines which should be concidered headers for each data part?


Kind regards

 

8 REPLIES 8
afv2688
16 - Nebula
16 - Nebula

Hello @Hamder83,

 

Could you please explain it better and five a maybe bigger example?

 

If not I am guessing you are looking for this:

 

Untitled.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

joshuaburkhow
ACE Emeritus
ACE Emeritus

Hi @Hamder83 

 

THere are going to be tons of ways to do this. Here is just one 🙂

joshuaburkhow_1-1580134324336.png

 

Hope this helps! If it does please mark as solved so others can find it on the community easily 🙂

 

Thanks!

Joshua

 

 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
RolandSchubert
16 - Nebula
16 - Nebula

Hi @Hamder83 ,

 

I'm not sure, if I understood the problem completely, but I assume, the two datasets are on one Excel sheet, separated by a header line, and entries for data have a numeric field [F1]. If that is true, you could set a "stream number" using a Multi-Row Formula tool, split using Filter tools and set the header using Dynamic Rename.

Sample workflow is attached. Will be interesting to see if I guessed correctly ...

 

Best,

 

Roland

olehr
8 - Asteroid

Hi @RolandSchubert

 

That solution was helpul.   However, I did not quite understand the "IF STRCSPN.... function.   Could you explain ? 🙂

 

 

Best, 

 

Ole Henrik

RolandSchubert
16 - Nebula
16 - Nebula

Hi @olehr ,

 

the STRCSPN([a], 'b') function returns the number of characters in field [a], that are not part of string 'b'. Using this function I check, if field [a] starts with a character (as all rows with exception of the "data rows" do). So translated the formula would be:

IF [Field1] starts with a character (not a number => header row of dataset of one of the header lines) THEN

    IF [Field1] of next row starts with a number (=> is a data row) THEN

        increase "Streamcount" by 1  (=> it's the header row of a new stream/data block)

    ELSE

        0    (it's one of the header lines before first stream)

    ENDIF

 

ELSE   (=> it's a row starting with a number => data row)

    Streamcount of previous row (is part of the stream, header has been defined before)

 

ENDIF

 

Hope this explains the idea of my approach.

 

Best,

 

Roland

  

olehr
8 - Asteroid

Thanks a lot @RolandSchubert,  that helped 🙂

 

Best 

 

Ole 

Hamder83
11 - Bolide

Robert 

Your a alteryx god! 

Holy, 

I know a lot comes with practice, but - how do i reach that level of knowledge? 


RolandSchubert
16 - Nebula
16 - Nebula

Hi @Hamder83 ,

 

oh no, far from being an Alteryx god ...

 

But seriously - to extend your knowledge, you have to use Alteryx. I started learning using the material provided by Alteryx Academy (Interactive Lessons, Videos) and tried to use Alteryx for all problems it seemed appropriate for  (even if it took more time in the beginning to create a workflow instead of using a spreadsheet ...).

An excellent learning resource are the weekly challenges - at one point I decided to solve the challenges, whatever was required. That way I learned to use tools and to solve problems  I would have never seen in my day-to-day business (or avoided if possible in any way).

In my opinion the most important learning tool is solving problems posted in the community. almost every time I solve a problem, I learn something. Maybe you just give it a try, it will evolve.

 

Best,

 

Roland

 
Labels