trying to make a column in my Dataview table that takes a number and checks it against a set of ranges, then returns a number depending on what, set of ranges it fits into.
Now class should hold the corresponding class, readily available for use as a value in other parts of your query. The way to read this structure is that the choice functions takes a comparison as its first parameter, f.ex. number <= 1, and if that is true, it select the second parameter, "Class A", and if false, it selects the third parameter, which happens to be yet another CHOICE(...) function.
This continues down the chain until it either hits a true value, and returns that class, or comes to check number <= 9, and finds that also false, where it then returns the "Unknown" value.
( A FLATTEN clause typically goes right before the WHERE clause, and after the FROM clause (if it exists) )