Case Statement in Magic ETL
Hello,
Is there a way to implement a Case Statement (not nested Case Statements) in Magic ETL?
Thank you,
Nick
Comments
-
Could someone help with this request?
1 -
Hi Nick!
There is a transform options in Magic that allow you to do case statement functionalities.
Under the "Edit Data" transform grouping you have the "Value Mapper" transform. This transform allows you to (much like a case statement) look at a specific column for a value, empty or null string, or text string, then based on whether that is found or not, either replace the value in the given column, or create a new column with the new value.
This is one example of an easy to use transform that can do some case statement logic. Often using this transform and other transforms, you should be able to duplicate most case statement logic. Sometimes a single transform will work, sometimes it won't.
Let me know if you have a specific example you'd like to look at. Hope this is helpful!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'2 -
Hi! I'd like to do a case statement that works on numbers (spend) and not on text. Can you help me out with that? For example:
if Site is A then pull Spend A
if Site is B then pull Spend B
end as Final Spend.
Thank you!
0 -
Filter your data set for Site A, Copy or rename Spend A as Final Spend
Filter your data set for Site B, Copy or rename Spend B as Final Spend
Append
0 -
And if not Site A or Site B, the ELSE part of a case statement?
So that you do not have rows disappearing from your data?
0 -
Hi, @user06381,
For the "ELSE" portion, you'll need yet another Filter tile. In this tile, configure it such that none of the conditions referenced in the other Filters tiles are true. So, in this Filter tile, you'd have Site not equal to "Site A" and Site not equal to "Site B". This way, the first filter returns Site A; the second returns Site B; and the third returns all others where NOT Site A and NOT Site B.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive