Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hybrid_man
Contributor II
Contributor II

Filter with limited value and sum with set expression

Hi, i have a question, is there a better way to resolve this issue.

I have a data with sales by country:

SALESCOUNTRY:

Load *

Inline [COUNTRY, SALES

USA, 5

CANADA, 4

CHINA, 8];

I want to show a filter only with USA and CHINA so i have created a field COUNTRY_USA_CHINA = IF(MATCH(COUNTRY, 'USA','CHINA'),COUNTRY)

I Want to show a KPI showing only sales for USA, so a have created a SUM with SET expressions:

SALES_USA = SUM({<COUNTRY = {'USA'}>} SALES)

The problem is, when i select CHINA from filter COUNTRY_USA_CHINA , sales in field SALES_USA is showing 0. Why? Set expression should disregard the current selection.

Is there a way to resolve this issue without calculating COUNTRY_USA_CHINA is QVD?


SALES_USA.png

1 Solution

Accepted Solutions
sunny_talwar

Create your filter like this

Aggr(Only({<COUNTRY =  {'USA', 'CHINA'}>} COUNTRY), COUNTRY)

View solution in original post

4 Replies
sunny_talwar

Create your filter like this

Aggr(Only({<COUNTRY =  {'USA', 'CHINA'}>} COUNTRY), COUNTRY)

agigliotti
Partner - Champion
Partner - Champion

you should use as below for usa sales:

SUM( {< COUNTRY_USA_CHINA =, COUNTRY = {'USA'} >} SALES )

hybrid_man
Contributor II
Contributor II
Author

Thanks, but that dosn't work  I think that You can't use calculated measure COUNTRY_USA_CHINA  in expression.

hybrid_man
Contributor II
Contributor II
Author

Thanks, that works fine