Query to create a condition on a database

Hi everyone, I would like to know how is the syntax to create a condition column (if) on a database, for example:
The column "PPG" already exists and i want to create the column "Gr" with this information.
If PPG = "MPA 90GRS" then Gr should appear "90".
Could someone help me with this calculated column, please?
Best Answer
-
you can easily created a beastmode case statement as
CASE WHEN `PPG` = 'MPA 90GRS' THEN 90 WHEN `PPG` = 'CTA 90GRS' THEN 90 END
Adding as many conditions as you want individually or this is another option
CASE WHEN `PPG` IN ('MPA 90GRS', 'CTA 90GRS') THEN 90 WHEN `PPG` = 'CLUMINOUS 70GRS' THEN 70 END
now if ,
PPG
contains a lot distinct values , you could ETL a table with those values and join it to your data.anyways, there is a lot different ways to do that. hope this helps
Domo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'1
Answers
-
you can easily created a beastmode case statement as
CASE WHEN `PPG` = 'MPA 90GRS' THEN 90 WHEN `PPG` = 'CTA 90GRS' THEN 90 END
Adding as many conditions as you want individually or this is another option
CASE WHEN `PPG` IN ('MPA 90GRS', 'CTA 90GRS') THEN 90 WHEN `PPG` = 'CLUMINOUS 70GRS' THEN 70 END
now if ,
PPG
contains a lot distinct values , you could ETL a table with those values and join it to your data.anyways, there is a lot different ways to do that. hope this helps
Domo Arigato!
**Say 'Thanks' by clicking the thumbs up in the post that helped you.
**Please mark the post that solves your problem as 'Accepted Solution'1
Categories
- All Categories
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 305 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3K Transform
- 106 SQL DataFlows
- 646 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 774 Beast Mode
- 75 App Studio
- 43 Variables
- 728 Automate
- 186 Apps
- 467 APIs & Domo Developer
- 61 Workflows
- 14 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 403 Distribute
- 117 Domo Everywhere
- 277 Scheduled Reports
- 9 Software Integrations
- 136 Manage
- 133 Governance & Security
- 8 Domo Community Gallery
- 44 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 112 Community Announcements
- 4.8K Archive