Filtered value over less filtered value in the same calculated field

Hi,

I have a calculated field to count distinct device IDs, applying two filters: country and segments (both with multiple choices). I’d like to know how this count compares to the total distinct devices in that country, with no segments filtered. I can create a KPI with both values separately just by selecting which filter I want to apply to that visual, but I don’t know how to have a KPI that depends on two values with different filters applied to each of them.

How can I create a KPI (percentage) to show this value?

Thank you.

Hi @victord

a. Create Parameters for Country and Segment
b.Create calculated field for Device ID Count that is based on Country and Segment, say Volume by Country Segment
sum(ifelse(IN(country, ${CountryParameter),
ifelse(IN(country, ${SegmentParameter}), 1, 0), 0))
c.Create calculated field for Device ID Count that is based on Coutry alone, say Volume by Country
sum(ifelse(IN(country, ${CountryParameter) , 1, 0))
d. Create Caclulated Field to compute Ratio, say KPI and format it as Percentage
Volume by Country Segment/Volume by Country
e. Use KPI calculated field for the visual and don’t directly filter the visual for the Country and Segment as they are already filtered in your calculated fields.

Regards
Giri

1 Like

Hi @victord,
It’s been awhile since we last heard from you, did you have any additional questions regarding the potential solution provided above or were you able to find a work around?

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you!

Hi @victord,
Since we haven’t heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!