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

Remove the last Row while processing

aysha6029
8 - Asteroid

Hi Friends,

 

I am having the below scenario. The Last record needs to be removed since that is a Summarized of the Value field. I need to load the data into the database where all the fields are being declared as Key Fields and Nulls are not allowed. Please help me to solve this issue.

 

S.NoNameValueCountry
1Mike200USA
2Jason300USA
  500 
9 REPLIES 9
anthony
11 - Bolide
  1. add record id
  2. sort desending on record id field
  3. use "2-" in select record tool

Sort ascending and remove record ID.

 

Or just fliter out nulls/is empty from column 1.

 

rahuls
9 - Comet

1. Use a Filter Tool and in its configuration select basic filter where Name Is Not Empty.

 

2. If you already know the number of records in your data, you can use Sample Tool as well.

MarqueeCrew
20 - Arcturus
20 - Arcturus

To remove the last row, use the sample tool and skip the last 1 record. 

 

http://help.alteryx.com/10.6/index.htm#Sample.htm?Highlight=Sample

 

image.png

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Paul1
6 - Meteoroid

Hi MarqueCrew, 

I actually have the asme issue but cannot use a record Id because the record changes every mth. Your suggestion re the sample tool would be great but I cannot see anywhere in the tool where you can skip the "Last" number of records. Am i missing something? Tks

AdamR_AYX
Alteryx Alumni (Retired)

Correct the sample tool is missing a Skip Last option.

 

The CReW macro pack (http://www.chaosreignswithin.com/p/macros.html) has a Skip Last N macro

 

SkipLastN.png

Adam Riley
https://www.linkedin.com/in/adriley/
Paul1
6 - Meteoroid

Thanks Adam, works perfectly - Cheers

SrinivasAnupoju
6 - Meteoroid

Thanks Adam, your macro pack perfectly worked for my case. 

 

I have a question, do you have any macro for parent child relationship where i can find the level of the parent and child and order them (I am currently doing it SQL with CTEs but not successful for the rest of the 50% of my case) I am need of a recursive organic macro for parent and child relationships. 

 

Any leads are highly appreciated. 

 

Thanks again. 

 

BR-Srini

mohinder_singh
6 - Meteoroid

Hi 

 

Can you show us how to do that?

 

According to manual you can skip starting records

jackchoy
7 - Meteor

This seems like a useful feature to bundle in, since files with trailer records are a pretty common concept.  Is there any possibility of building this into the standard Sample tool, instead of as a macro?

Labels