Calculated field as a filter is not resulting in the same for two different visuals

Two different visuals, one is a KPI visual and one is a table. They both have similar filters. However, the table shows I have data, but the KPI shows I have no data. The only one filter that is making this KPI not working is a calculated field integer. I have make it greater than equal to or less than equal to this “calculated field integer” on both visual. KPI does not work, Table works. I was wondering what is causing this issue.

Hi @Jane

You forgot to include your definition of the calculated field. We would need to look at that in order to understand what is going on and then can suggest a solution.

Regards,
Giri

Hi @Giridhar.Prabhu

What do you mean by lacking a definition in my calculated field? The calculated field is the sum of values over 5 years. Let me know if you are able to suggest a solution for me. Thank you.

Do you have any other filter used in the visual? any date filter?

Also the table visual contains the strataNumber field and the calculation is done based on each row visible in the table. However for the KPI field, since no categorical field is added, the comparison is made based on the aggregated value , thus not returning any record.
Can you try calculating the measure that you are filtering at the strataNumber level and then use it for filtering? In a way we are forcing the compiler to calculate and check for each Stratanumber.

Thanks,
Prantika

There are other filters used in the visual, but no date filter. If I add categorical field it will only be showing 1.

Do you mean by adding all the filters into a calculated field instead ?

apologies for confusing you.

Since you confirmed there is no date filter will skip that check. Can you share what field are you filtering and what condition did you use?

Or if you can create a sample report in Arena to take a quick glance, will be helpful.

The field that I am filtering is a calculated field of a sum of amount over 5 years (Filter A) and I have two parameters (Para A: min) and (Para B: max) so I want it to get the distinct count in KPI visual with that Filter A > min and Filter B < max. However, it does not work

Ok, now I got some idea.
can you rewrite the sumOver5Y as :
(Assuming from the table visual, you want to see if the condition match for strataNumber)

sumOver(ifelse(cond1 or cond2 …, amount,0),[strataNumber],pre_agg)

you may need to tweak the formula based on your use case. But what we are trying to do here is rather than calculating total sum for 5 years, we are calculating sum of 5 years for each strataNumber and then using the filter.

One more callout, since we are using LAC, if filter does not work, you may need to rewrite the filter as a calculated field. Some thing like
ifelse($minparam< sumOver5Y, , NULL) and use this in the KPI measure to calculate count.