Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Most Recent Database Data

jeffjose33
7 - Meteor

Hi, 

 

I'm querying a database for workflow data (accounting data) that can be updated as often as monthly if the specific account/location is still active. The database stores all of the data (aka stores the same account data for May, June, July etc) and I want to be able to to take the most recent data point for each account/location, whether it was this month or 3 years ago. I currently have a sort and sample combination to get me this data, but I am wondering if there is a better way to do this?

 

jeffjose33_0-1633965594165.png

 

If I want to make this an analytic app in the future so that users can check account information, would it be better to use a workflow constant for a date and use that as a reference for the most recent data? I ask bc my workplace has a workflow from a Big 4 consultant and it utilizes workflow constants, I'm just not sure if that is the best way to move forward.

 

Any guidance is appreciated!!

 

3 REPLIES 3
fmvizcaino
17 - Castor
17 - Castor

Hey @jeffjose33 ,

 

If you are downloading a large dataset from your accounting system, I would suggest you using in-database tools since it would use your data source performance to run everything and only download the data you actually need.

 

Related to your date question, the idea of using a workflow constant is if you have a lot of formulas and places using that same date, then you can change all at the same time by changing the workflow constant.

 

 

Best,

Fernando Vizcaino

jeffjose33
7 - Meteor

Thanks Fernando. I am having trouble recreating a formula that utilizes date, which is why I wasn't using the in-database tools. 

 

I'm trying to recreate this formula with the Formula In-DB tool, but I'm not sure exactly how to do it. 

jeffjose33_0-1633974570848.png

 

It takes date info from the database that looks like this: 

 

jeffjose33_1-1633974672296.png

 

And transforms it into this format: 

jeffjose33_2-1633974708837.png

Do you know how I can do this?

 

fmvizcaino
17 - Castor
17 - Castor

Hey @jeffjose33 ,

 

I've seeing a few posts talking about Julian date to standard date in sql, but not sure if that would work since I don't have a lot of SQL experience.

 

What I would do, since you are basically filtering the most recent date, I would do the sort and the sample in-db and use the data stream out tool to mix that with your local formula tool. 

Something like this:

fmvizcaino_0-1633975362642.png

 

One problem you may have there is related to the sample tool in-db, since it doesn't have the option to group by, so you would need to develop that directly in the input in-db tool query or doing something like this to get only the most recent date and then use a inner join.

fmvizcaino_1-1633975569976.png

 

 

 

Best,

Fernando Vizcaino

 

 

Labels