Comparing beast mode calculations and resulting in a string
Due to confidentiality reasons, I'm trying to create a card where it shows if a student has Completed or Not completed a series of tests (we don't want to reveal their actual scores).
The Complete/Incomplete column keeps showing as Incomplete no matter what I try to do. I tried switching it to Integers (Complete = 1, Incomplete = 0, but that just made the entire column 0). I've tried adding "sums" around my beast modes and that didn't work.
I suspect this is a result of this limitation. But any suggestions? Ideally I want to put this in a pivot table so I can send the report to the interested parties once a month.
- Points Numerator = Integer from the dataset
- Points Denominator = Integer from the dataset
- Grade = Beast Mode calculation of
`PointsNumerator`/`PointsDenominator`*100
- Passing Grade = Beast Mode calculation where I manually add in the Passing Grades. There are 5 tests that have unique passing grades, and 5 that are Pass/Fails, hence the 100%.
(CASE when `GradeObjectId`=235 then 84.9 when `GradeObjectId`=266 then 84.9 when `GradeObjectId`=276 then 84.9 when `GradeObjectId`=279 then 79.9 when `GradeObjectId`=281 then 84.9 else 100 End)
- Complete/Incomplete = Beast Mode calculation where I compare the values
(CASE when 'Grade' >= 'Passing Grade' then 'Complete' else 'Incomplete' End)
Best Answer
-
Hi @MB_Dem
If Grade and Passing Grade are columns does your beast mode use single quotes or back tickets? With the way you have it now it's comparing the string 'Grade' with the string 'Passing Grade' which will always equal Incomplete (P comes after G so Grade is never greater than Passing Grade).
Try this (it's expanded because you have it defined as a beast mode and you can't reference a beast mode column within another beast mode):
(CASE WHEN `Grade` >= (CASE when `GradeObjectId`=235 then 84.9 when `GradeObjectId`=266 then 84.9 when `GradeObjectId`=276 then 84.9 when `GradeObjectId`=279 then 79.9 when `GradeObjectId`=281 then 84.9 else 100 End) then 'Complete' else 'Incomplete' End)
From a design standpoint I'd recommend using a webform to contain the GradeObjectID along with the passing grade amount and then join that dataset to your original dataset. This way you have one central location to update your passing grades rather than hunting through all the beast modes you'll have defined. Once you have that in place it'll simplify your beast mode to be:
(CASE WHEN `Grade` >= `Passing Grade` then 'Complete' else 'Incomplete' End)
Alternatively instead of putting this logic into the beast mode just include it in your ETL or Dataset View (my recommendation) when joining the two datasets together so it's already calculated in the same location.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1
Answers
-
Hi @MB_Dem
If Grade and Passing Grade are columns does your beast mode use single quotes or back tickets? With the way you have it now it's comparing the string 'Grade' with the string 'Passing Grade' which will always equal Incomplete (P comes after G so Grade is never greater than Passing Grade).
Try this (it's expanded because you have it defined as a beast mode and you can't reference a beast mode column within another beast mode):
(CASE WHEN `Grade` >= (CASE when `GradeObjectId`=235 then 84.9 when `GradeObjectId`=266 then 84.9 when `GradeObjectId`=276 then 84.9 when `GradeObjectId`=279 then 79.9 when `GradeObjectId`=281 then 84.9 else 100 End) then 'Complete' else 'Incomplete' End)
From a design standpoint I'd recommend using a webform to contain the GradeObjectID along with the passing grade amount and then join that dataset to your original dataset. This way you have one central location to update your passing grades rather than hunting through all the beast modes you'll have defined. Once you have that in place it'll simplify your beast mode to be:
(CASE WHEN `Grade` >= `Passing Grade` then 'Complete' else 'Incomplete' End)
Alternatively instead of putting this logic into the beast mode just include it in your ETL or Dataset View (my recommendation) when joining the two datasets together so it's already calculated in the same location.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1
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