Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Partner
Partner

Validate all values in an input box

Hello,

I've got an input box where the user will introduce a list of values that I will filter in some field.

The values must be numbers with two decimals maximum and they'll be separated by the symbol "|". So an example of a correct entry would be:

4565.34|445|125543.56|90

and an example of a wrong entry would be:

4565.34|445|125543.56|90.776 or d4565.34|445|125543.56|7aab....

I know how to check if one item of the list meets the conditions, but I don't know how to iterate it to all items in the list.

Any idea?

1 Solution

Accepted Solutions
Partner
Partner

Re: Validate all values in an input box

I found a solution that is good enough:

=(len($)>0 and len(purgechar($,'0123456789.|')) = 0 and index($,'..')=0) or len($)=0

2 Replies
MVP
MVP

Re: Validate all values in an input box

You can use this expression to give a true or false value depending on whether each list value is a number or not

so it is easy to extend from there:

=$(=Concat( 'IsNum(''' & SubField( vInputVar ,'|' , ValueLoop(1,SubStringCount(vInputVar,'|')+1)) & ' '')', ' AND ' ))

It can be generalized into a "function-variable" by using parameters too...

Partner
Partner

Re: Validate all values in an input box

I found a solution that is good enough:

=(len($)>0 and len(purgechar($,'0123456789.|')) = 0 and index($,'..')=0) or len($)=0