Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Truncate the transactions in the last slot of the last hour of the day in Alteryx


Hi All,


Stuck in an issue. Have been working on time series data. I've divided the data in an interval of 10 min slots.

Now I need to create a carry over file, in which the data of last hour and last slot had to be skipped and saved in a carryover file. Next day, when the workflow runs for the new data, the records in the carry over file will be appended to the rest of the data. The problem I am facing particularly, is separating these records. As the last record can occur at any time, there is no fixed time when the last record  will occur. Naturally, the number of transactions in the last slot of the day are variable as well. 
(The reason of skipping the records is because, for each transaction in each slot, the state: free/waiting has to be taken from the immediate next transaction. For the last transaction of the day, there will be no record to look forward to. Hence the need to save the transactions in that particular slot and append them in the data next day)
PS. It is not necessary, the data is of same day. Data of multiple days can be present, but the interval will be 24 hrs only.
Have attached a dummy workflow, for better understanding.
In case of any doubts, feel free to ask.

Hi @NancyS


you could use the sample tool and select last 3 as the option to do so, just make sure your data is sorted before using it!


If you have multiple transactions, you will need to group by transaction ID or something like that! I hope it helped, tell me if you have other questions!


Hi @Ladarthur Appreciate your help!


But we can't select 3 or any number in the sample tool. As the number of transactions in the last slot aren't fixed. It can be any number. The transactions in the last slot (in the dummy workflow) are 3 just for reference. 




I saw another potential solution, find it attached!


Thanks @Ladarthur . The maximum of time_slot_end works for the data of same day. But  there can be multiple dates in the data, in that case this won't work


You could add a date for the max it should work!


Hi @NancyS 


Here's what @Ladarthur was referring to




Add in a Date field and find the max slot for each date.  Join back to your original data.  The L output gives everything except the last slot for each day.  The J output gives the last slot for each day, which you can save to a table to be read the next day.




Hi @danilang ! Thanks for guidance, figured it out. The solution is similar to the one you have suggested, except I created sample rows for last 10 minutes. 10 minutes=600 seconds. 600 rows generated for each second. and then applied the logic similar to the suggested one. 




Thanks @Ladarthur