Alteryx Designer Desktop Discussions

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

Generate Random Records for Activity Table

tjamal1
8 - Asteroid

Hello ,

 

I am trying to create a activity Table for students which consist of these columns and requirements 

1 ID (Incremental)

2 Student (001) for one student only 

3. Date Column (Any Date)

4. Activity Type (In School , HomeWork , Assessments)

5 Time Spent on Activity with following conditions 

    i  Accumulative Time Spent In-School should not be greater than 25 hours

    ii  Accumulative Time Spent HomeWork should not be greater than 15 hours

    iii Accumulative Time Spent Assessments should not be greater than 8 hours

   

A Student contains at-least 100 records 

 

 

Sample Data

IDStudentDateActivty TypeTime Spent (in mins)
100110/23/2019In-Class60
200110/24/2019Homework30
300110/25/2019Assessments10

 

 

How can i generate records based on above requirements specially point (5)?

 

 

4 REPLIES 4
danilang
19 - Altair
19 - Altair

Hi @tjamal1 

 

Here's one way you can do it

 

w.png

Generate the 3 types of activities separately.  Each container generates 10000 rows of activity data in multiples of 5 minutes.  After the running total, the Multi-row formula assigns a new student ID every time the running total passes a new 25 hour booundary, i.e. 0-1500 minutes is student 1, 1500-3000 is student 2, etc.  The boundaries are adjusted in each container according to your requirement 5.  Union the three activity types and then count the number records per student and filter to pass only those with more than 100 records.  The next join filters only those students.  format the student ID, sort and then add the ID field.  The results look like this

 

 

r.png 

 

The workflow generates approximately 100-120 students 

 

Dan

tjamal1
8 - Asteroid

Hi , Thanks for the detailed reply and workflow 

 

I was wondering is there anyway to generate random date between 

 

10-23-2019  and  10-23-2020 for each student 

 

and increment it accordingly so the minimum date of each student should be any random date between  10-23-2019  and  10-23-2020 and increment those dates for each student by any random days 

danilang
19 - Altair
19 - Altair

Hi @tjamal1 

 

I added a new multi-row tool configured like this

rd.png

If it's the first row for this student pick any random day from 2019-10-23 to 365 days after

else increment the previous date by 0-2 days

 

Dan

tjamal1
8 - Asteroid

Thank you , That worked for me . Very Much appreciated the help.

 

Have a good Day !

Labels