How to save last 7 days data in table using Alteryx workflow?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi All,
i am having one requirement, where i am pulling data from DB with some logics and storing it on SQL Server table.
i need to implement logic in Alteryx to store only last 7 days data in table, so that Alteryx workflow should check the max date from table column ("DateAdded") and if it is more then seven days, the delete the older data and save the latest data. any ways SQL Server target table should have 7 days data only.
Regrds,
AlteryxTech
- Labels:
- Developer Tools
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @technohub,
The way I would do this is using the filter tool and only sending the data from the true output with a formula like this:
[Date]>DateTimeAdd(DateTimeToday(),-8,"days")
The community has some quick and easy videos on formulas here Expressions and DateTime-Functions Cheat-Sheet blog
Any questions or issues please ask :)
HTH!
Ira
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you @IraWatt for your quick help.
this solution will help to get last 7 days data from source! but my requirement is to maintain 7 days data in target table available on sql server.
we are getting data on daily basis and we are storing that data in target table, but target table should not have data stored for more then 7 days.
Do we have tools which can check the target table data is not having more then 7 days data and if its having then that tool should delete that data. hope this makes my reequipment clear.
Thank you once again.
