How to filter by null values when using Variables |
1. Create a new Dashboard 2. Add a panel 3. Go to Dashboard settings > Variables 4. Click on Add variable button, and configure the new Variable as shown below and save it remedy,{"sql":"SELECT CASE WHEN `CHG:Infrastructure Change`.`ASCHG` IS NOT NULL THEN `CHG:Infrastructure Change`.`ASCHG` ELSE 'Not Assigned' END FROM `CHG:Infrastructure Change`"} 2. Create a dashboard using the below SQL query, which will replace the null values with the text Not Assigned. SELECT `CHG:Infrastructure Change`.`Infrastructure Change ID` AS CRQ, `CHG:Infrastructure Change`.`ASCHG` AS Assignee, CASE WHEN `ASCHG` IS NULL THEN 'Not Assigned' ELSE `ASCHG` END AS `ASCHG`, `CHG:Infrastructure Change`.`Priority` AS Priority FROM `AR System Schema`.`CHG:Infrastructure Change`WHERE `ASCHG` IN ($user) 3. Records with null or existing values can now be selected as follows: For more information on how to use and create Variables, refer to the following BMC documentation. |