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
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.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1
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
- 10.5K All Categories
- 5 Connect
- 915 Connectors
- 250 Workbench
- 459 Transform
- 1.7K Magic ETL
- 69 SQL DataFlows
- 476 Datasets
- 186 Visualize
- 250 Beast Mode
- 2.1K Charting
- 11 Variables
- 78 Cards, Dashboards, Stories
- 16 Automate
- 354 APIs & Domo Developer
- 88 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 245 Distribute
- 62 Domo Everywhere
- 242 Scheduled Reports
- 20 Manage
- 41 Governance & Security
- 170 Product Ideas
- 1.2K Ideas Exchange
- 10 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive