How to filter nulls in a parameter

Hi @sergio, welcome to the Quick Sight Community, hope this approach helps:

  1. previous_event_code_param:
ifelse({event_code} = ${selectedeventcode}, {previous_event_code}, NULL)
  1. filtered_previous_event_code:
coalesce({previous_event_code_param}, '')
  1. previous_quantity:
ifelse({event_code} = {filtered_previous_event_code}, {quantity}, 0)

If you still encounter issues, double-check the following:

  • Ensure that your parameter selectedeventcode is correctly defined and matches the values in your event_code field.
  • Verify that the coalesce function is effectively filtering out NULLs by examining the results in a simple table visualization first.
  • Use aggregation functions like sum or max if your calculated field needs to aggregate values across different rows.

These steps should help you filter out NULL values and calculate the previous event’s sales correctly for your line chart.

In case you need further assistance with your problem, please create a sample dashboard with sample dataset showing your problem state using Arena and post it here. (Details on using Arena can be found here - Quick Sight Arena).

Did this solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the Quick Sight Community!