Changing a Column from Measure to Dimension
Hello all,
I am seeing if there is a way I can convert a column named 'isActive' from a measure to a dimension. Currently the values show as '0' or '1' as a measure, but I want this column to be under the dimension field and display as 'True' or 'False.'
I am trying to avoid a beast mode calculation because the dataset the cards are built from is used across many different cards and it will be very inefficient to add the beast mode calculation to the existing and also new cards.
Any suggestions will be appreciated!
Comments
-
Hi @SLam
You can use a beast mode with a case statement to solve you problem.
CASE WHEN `isActive` = 1 THEN 'True' ELSE 'False' END
The above is assuming that You only have values of 0 and 1 (anything other than 1 is considered False)
If you want to be alerterd if you get a value other than 0 and 1 you could do something like:
CASE WHEN `isActive` = 1 THEN 'True'
WHEN `isActive` = 0 THEN 'False'
ELSE 'ERROR' ENDYou said you didn't want to utilize a beast mode because you'd have to do it reimplement it on every card that uses that dataset however you can select the checkbox on the BeastMode that says Share Calculation on Dataset and it will then be available to ALL cards which utilize that dataset so you don't have to re-implement it, just change the field it's displaying.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
If this is already a part of a magic ETL data flow you could use a value Mapper tile to convert that column to textual representations by overwriting the original value.
It should look something like this (make sure you select your isActive field is selected for "Select a column to search")
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Thank you so much for your input on this.
Another question I had:
The dataset the card is pulling from is a DataFusion. Is it possible to edit the column's data type from the DataFusion level?
0 -
https://www.youtube.com/watch?v=9HYx1vn3HRM
It's a little bit of work, but you can alter the schema of your Fusion using the JavaCLI. Here's a link to a tutorial where i rename a column but you can also change the data type.
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"1 -
Hello @jaeW_at_Onyx
Thank you for that video. The JavaCLI looks a bit too much.
Is there no other way to change the data type via the Edit Fusion UI on Domo? Would the only other way be to rebuild the fusion?
0 -
Even if you rebuild the fusion, in the Domo UI there is no way to change the data type.
There is a new data views beta that will give you more control over editing the schema of views. Ask your CSM for details.
You'll have to move all your cards to the new dataset though.
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 -
Hello @jaeW_at_Onyx
Could you verify if a value Mapper tile could fix this as well? This was mentioned in one of the replies above.
0 -
!!!
haha, you initially said you wanted to alter a fusion. Of course you can fix a data type in ETL. You can use any ETL engine, MySQL, Magic or Redshift to change data types.
In Magic you should use Set Column Type IF the data can be coerced to the new data type. Value mapper is most appropriate if you need to change the values in the column first.
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
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 101 SQL DataFlows
- 622 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 748 Beast Mode
- 59 App Studio
- 41 Variables
- 686 Automate
- 176 Apps
- 453 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 396 Distribute
- 113 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 125 Manage
- 122 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 109 Community Announcements
- 4.8K Archive