DataFlow ETL to change column values based on values in another column

We recently discovered a data tracking issue that affects one of our datasets.
The result is that the Revenue values have become meaningless after 24th April 2018. The other columns of data are ok and are still required.
My aim is to change the all Revenue values to 0 when the date is greater than or equal to 24th April 2018.
I have been trying to do this in a DataFlow but have been unsuccessful so far.
I attach a screenshot of how the table is structured.
Any ideas of what to use in the flow would be much appreciated. Thanks
Comments
-
select
case when `Activity Date`>='2018-04-24' then 0 else `Revenue` end as `Calculated_Revenue`
If you wanted to save the field with the same name, then you could just end it with "end as `Revenue`" instead.
1 -
How would you do the same in magic ETL.
For instance if I need to coalesce one column to another only when value is in a pattern0 -
there isn't an equivalent of COALESCE or CASE in Magic 1.0.
You can use FILTER to create your CASE switches. Then use a second set of FILTERs on NULL and NOT NULL to define the COALESCE (which value you want to prefer to keep) then use APPEND to bring all the values together.
Be careful in defining your FILTERs. There is no ELSE equivalent, so carefully define an ELSE clause as the OPPOSITE of your FILTERs.
In the Magic 2.0 beta you can implement SQL / Beast Mode in a scripting tile which may make this story easier. Just be careful, b/c the Magic ETL does NOT create a SQL engine instead, the command gets interpolated into a JAVA (or similar) based implementation of the SQL function.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 656 Datasets
- 115 SQL DataFlows
- 2.2K Magic ETL
- 811 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 80 App Studio
- 45 Variables
- 771 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 77 Workflows
- 23 Code Engine
- 36 AI and Machine Learning
- 19 AI Chat
- AI Playground
- AI Projects and Models
- 17 Jupyter Workspaces
- 410 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 10 Software Integrations
- 142 Manage
- 138 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive