7 Replies Latest reply on Oct 3, 2018 3:26 PM by Joe Oppelt

# Help on Using Parameter and Calculation (Case) as filter.

So I've doing similar calculations before but for some reason this time my parameter calculation isn't working

The rest is doing fine but "All" (a custom parameter I added Manually) isn't

My Calculation is.

CASE [Country Parameter 1]

WHEN 'AUS' THEN [Country]= "AUS"

WHEN 'CHN' THEN [Country]= "CHN"

WHEN 'EUR' THEN [Country]= "EUR"

WHEN 'USA' THEN [Country]= "USA"

WHEN 'All' THEN [Country]= "AUS" OR [Country]= "CHN" OR [Country]= "EUR" OR [Country]= "USA"

END • ###### 1. Re: Help on Using Parameter and Calculation (Case) as filter.

[Country Parameter 1] = ALL or  [Country Parameter 1] = [Country]

This would be a Boolean.  If the parameter = ALL then the value is true, or if the country field equals the parameter then the value = true.

Put that on your filter and select for TRUE.

• ###### 2. Re: Help on Using Parameter and Calculation (Case) as filter.

May be This

IF

[Country Parameter 1]="All"
OR[Country Parameter 1]=Country

THEN "TRUE"

ELSE "False"

END

• ###### 3. Re: Help on Using Parameter and Calculation (Case) as filter.

So like this?

CASE [Country Parameter 1]

WHEN 'AUS' THEN [Country]= "AUS"

WHEN 'CHN' THEN [Country]= "CHN"

WHEN 'EUR' THEN [Country]= "EUR"

WHEN 'USA' THEN [Country]= "USA"

WHEN 'All' THEN [Country]= "AUS" OR [Country]= "CHN" OR [Country]= "EUR" OR [Country]= "USA"

[Country Parameter 1] = ALL or  [Country Parameter 1] = [Country]

END

I tried different combos. Not working

• ###### 4. Re: Help on Using Parameter and Calculation (Case) as filter.

Not working

• ###### 5. Re: Help on Using Parameter and Calculation (Case) as filter.

Just this.  One line of code.  Nothing else.

[Country Parameter 1] = ALL or  [Country Parameter 1] = [Country]

No CASE.  No IF.

That one line of code will get you either the one country the user selected, or all countries if that's what he picked.

• ###### 7. Re: Help on Using Parameter and Calculation (Case) as filter.

See Sheet 10.  this is how it should work.

And if you take country off ROWS, it just sums up all the countries if you pick ALL.