The above formula works well, but if the parameter is blank, it will show no data.
Let’s add some code, that will show all of my data, when the parameter is blank.
IF my parameter is blank
THEN set this calculation to TRUE
ELSEIF my parameter matches the data field, then set this calculation to TRUE
ELSE set this calculation to FALSE`
Here is the actual Sigma code:
If(COALESCE(Trim([Stock Parameter]),“”) =“”, true ,Contains([Stock Parameter] , [Stock] ) )
So this is pretty good, and the formula above works well, but it will produce exact and also partial matches. For example, let’s say that you have these 3 stock symbols:
AP AA AAPL
When you type AP into the parameter, this filter will show rows that have both AP and AAPL (because AAPL has a AP in the middle).
If you want a precise match, so that, when you type AP, it will find all rows with AP, while ignoring rows with AAPL, APP etc…, here is a more complex formula:
If(COALESCE(Trim([Stock Parameter]),“”) =“”, true ,Contains(“,” & [Stock Parameter] & “,” , “,” & [Stock] & “,”) )
Please remember, that in order to make any of these formulas to work, you need create a filter off of them, then set that filter to only include true values.