data count
india germany england 7
india england france 4
If I create a new column - CountryList Like:-
Ifelse(contains(data,‘india’,‘India’,
contains(data,‘england’,‘England’,
‘others’)
For this new columns created Count for India should be 11 and england should be 11 as well.
But its only considering one contains statement and ignoring other . hence If count for India is 11 , then count for england is not coming as 11.
Hi Sanjeeb,
We need to provide users with a country name drop down, with all the countries listed in the data column.
Now
If User Selects India Count should be 11.
If User selects England Count Should be 11.
If User selects Germany Count should be 7.
if user selects France count should be 4.
Can you try making your control with the parameter. You will need to hard code the values in as your dataset doesn’t seem to have those values as a unique column.
I created country parameter and wrote this calc:
sumOver({count},{CountryParameter}],PRE_FILTER) .
Error:-
Expression sumOver({Count},[${CountryParameter}],PRE_FILTER) for function sumOver has incorrect argument type sumOver(Number, String List, ). Function syntax expects Numeric, List, Calculation Level Numeric, List ‘sumOver(Number)’.
I have validated the datatype for measure is numeric only.
If I Remove From calc, i.e ( sumOver({Count},${CountryParameter},PRE_FILTER)
This calculation is not showing any error and the output is 11 for both rows. when enabling country filter to using parameter, everything goes blank.
Let’s not over complicate this. What @Vivek54 wants to do can be accomplished with a Custom filter having Contains condition. See screen shot below.
The drop down value set will need to be provided as a static set.
I’m marking this as solution to this question for now. Let us know if there are further questions.
Yes. It can’t be used with multi select parameters. I suggested that approach since the explanation provided seemed to indicate need for single select and it wasn’t mentioned that you needed to multi-select.
We can use a slightly different approach to address multi select use case. This is recommended only if the max number of countries per record is a known and low number. (In your example, you have 3 countries per record. You should be able to extend below solution to say 10 countries per record.)
You should create calculated fields that extract each of the countries from the list. Country1 split({Country list},' ',1) Country2 split({Country list},' ',2)
Likewise, create Country3 etc.
Create a multi select parameter and a control with static values.
Create a filter group that compares each of the calculated fields with the multi select parameter. These filters are grouped together with OR condition. (See below)