Alteryx Designer Desktop Discussions

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

How to generate a new record with the date of the current day

bvj
6 - Meteoroid

Hi everyone!

 

There is probably a simple solution for this but I haven't figured it out.

 

I have a flow that runs data every day. But I would like to track the development of the data on a daily basis. I'm using the summarize tool to get all the average numbers on one record, and it is these average numbers I would like to generate a new record for every day with the current date of the day.

 

I have played around with the Generate Rows tool but no luck. I guess I just don't know how to use it.

 

Example:

 

 

Date

Avg number

Today

12-11-2020

10,5

Today+1

13-11-2020

11,2

Today+2

14-11-2020

10,4

14 REPLIES 14
Qiu
20 - Arcturus
20 - Arcturus

@bvj 
Is this what you need?

Capture.PNG

joshuaburkhow
ACE Emeritus
ACE Emeritus

Hey @bvj 

 

A couple things you need to do: 

 

1 stream to build your label (ie Today + x ) : You can take the ordered list, pull the bottom row, get the last character as a number and add 1 then concat "Today+" + tostring(number)

 

1 stream to get your next date which is just two functions: max(Date) then DatetimeAdd(ToDate(Date()),1,"days")

 

1 stream to do a average. 

 

Once you have all 3 of these individual numbers,  do a join by position to get a single 'new' row and then use the append tool to add to original dataset

 

Hope this helps! 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
bvj
6 - Meteoroid

Thanks. I have applied the solution and will see tomorrow when we have a new date if it works.

bvj
6 - Meteoroid

(This message is just to be ignored - don't know how to delete it)

bvj
6 - Meteoroid

@Qiu 

Unfortunately it does not work. Today I still only got one line instead of two.

 

With the right solution I should have two records: One for yesterday (12-11-2020) with the avg numbers for yesterday, and another record with the avg numbers of today (13-11-2020).

 

My output is a summarize tool with one record that updates every day. I would very much like to record the updated number on a new generated record for every day.

bvj
6 - Meteoroid

@joshuaburkhow 

I'm sorry but I don't completely understand your solution, could you provide an .yxmd example? If it's not too inconvenient. 

Qiu
20 - Arcturus
20 - Arcturus

@bvj 
If I understand correct, you data updates everyday, so how can we get the data yesterday?

If that is the case, we need to have a Datalake or sort of thing. And if the data is not big, we can export to a Alteryx Database file then retrieve it.

Let me know.

bvj
6 - Meteoroid

@Qiu

Yes a data lake where we store a new record for everyday. Alteryx database would definitely work as output.

Qiu
20 - Arcturus
20 - Arcturus

@bvj 

Made a sample flow for your reference.

Basically, the flow will read 'yesterday' data and join with 'today' data then output to update 'yesterday' data.

1112-bvj.PNG

Labels