I have a Text Field Multiline Control which takes in comma separated list of values. I am able to pass on these values to a filter to get my data from the data source. I want to calculate the number of values entered by user in this control to be used in other calculated fields. For example, if user enters Code1,Code2,Code3 then I should be able to use 3. There is no limitation on user on number of values they can enter, so, I can’t use a never ending ifelse statement.
You remove the commas in your string with replace(${yourString}, ",","") , then you count the letters and compare it to the original. In the end you add +1, because it is one more element than commas.
Did this solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the QuickSight Community!
Thanks for suggesting this route. This does not work for my use case because my parameter is a multi value parameter and function strlen does not accept a String List (values returned by parameter are in the form of a list rather than a single string).
It works if I keep the parameter as a single value text field parameter and keep adding multiple codes separated by comma but I can’t use it because my backend data will not have any row with more than 1 value in code column separated by comma.
Do you use the multiline-parameter to filter these codes in column that contains codes? If yes, you could create a distinct_count calculation on the column containing the codes. The result will be the amount of codes selected in your parameter.
Could this be a solution?