Complete the code to return 'High' when Sales is greater than 1000, otherwise 'Low'.
SalesCategory = SWITCH(TRUE(), Sales > [1], "High", "Low")
The SWITCH function checks conditions in order. Using TRUE() allows logical expressions. Here, Sales > 1000 returns 'High', else 'Low'.
Complete the code to categorize scores: 90+ as 'Excellent', 70+ as 'Good', else 'Average'.
ScoreCategory = SWITCH(TRUE(), Score >= [1], "Excellent", Score >= 70, "Good", "Average")
The first condition checks if Score is 90 or more for 'Excellent'. The order matters to assign correct categories.
Fix the error in the SWITCH function to correctly assign 'Low', 'Medium', or 'High' based on Quantity.
QuantityLevel = SWITCH(TRUE(), Quantity <= 10, "Low", Quantity <= [1], "Medium", "High")
The medium level should cover quantities up to 20. Using 20 ensures correct ranges without overlap.
Fill both blanks to categorize Age into 'Child' (<=12), 'Teen' (<=19), or 'Adult'.
AgeGroup = SWITCH(TRUE(), Age <= [1], "Child", Age <= [2], "Teen", "Adult")
Children are 12 or younger, teens up to 19, adults above. The blanks must reflect these age limits.
Fill the blanks to assign product categories: 'Electronics' for code 1, 'Clothing' for 2, else 'Other'.
ProductCategory = SWITCH(ProductCode, [1], "Electronics", [2], "Clothing", "Other")
SWITCH matches ProductCode to 1='Electronics', 2='Clothing', else defaults to 'Other'.