Comparing beast mode calculations and resulting in a string

MB_Dem
MB_Dem ⚪️
edited September 9 in Card Building

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

  • GrantSmith
    GrantSmith Indiana 🔴
    Accepted 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.