I have a parameter linked to a data field in the dataset. This parameter is filtered in this insight visual if the data in not inside the dataset, I have already set it to COUNT(uniquevalue) = 0 in one of the block if, and set a custom message. However, it still shows me no data. Wondering if there’s any solutions to this?
Is it that if there is no data in the dataset, it will always show No data, and not custom message?
Hello @Jane, are you able to share an anonymized view of the custom narrative function that you have built out for this? Custom narratives can be a bit tricky but we should be able to figure out a solution to this.
I am thinking if we add a 2nd calculation within the narrative that will contain data whether your unique value exists or not, we may be able to bypass the No Data display even if we don’t directly return the value. If I see how your narrative is built, I can guide you further. Thank you!
Hello @Jane, my first thought is what happens if you try replacing If Strata.uniqueGroupVauesCount = 0 with isNull(Strata.uniqueGroupVauesCount). I have a feeling that won’t work, but it is a quick fix to try.
Otherwise, what I would do, is add another computation to your insight that will always return a value. Maybe adding a totalAggregate insight calculation based on a field that does return a value when that filter is applied. Make sure and add that field to your field well on the visual then you can click this button to add it:
Now, add it into your If statement:
If isNull(Strata.uniqueGroupVauesCount) AND totalAggregate >= 0
That should make sure the visual doesn’t display No Data and you shouldn’t have to actually display the computation you added. Let me know if that helps!
Yes I do understand your approach. However, that “Strata” I filtered to, is not in the dataset at all. So, even if I add another computation total aggregate in, I will still get no results?
Parameter A - Apple
Strata = Apple
However, Apple does not exist in the dataset at all, meaning the values for Apple does not exist as well. What should I do in this case to bypass?
Hello @Jane, yes, I understand. My thought is that if you add another field into your field well that will return data when Strata is NULL, and add that as a new computation, then you should be able to return an alternate message since the visual will contain data.
Rather than using the Block IF function, you can click the Insert Code dropdown and select an Expression. Within the Expression editor add an ifelse statement which will function similarly to a calculated field. You can then use this logic: ifelse(isNull(Strata.uniqueGroupValuesCount) AND newCalculation >= 0, concat(${BuildingNameParam}, " does not contain a deprecation report", your alternate reponse here)
Mainly, your visual must contain data to display something. So I think if we do something like this, we can trick the visual into returning your custom error message. I will mark this as the solution, but please let me know if you have any further questions. Thank you!