Using service to 'query' values in data set (view data) - is it really one service per query?

Sorry if this is a bit amateur, but is my approach correct with the following ...

The goal is to generate some statistics namely how many records in the data set have the status '20' and how many have 40.

An onClick event assigned to the above button will execute the below service.

Am I correct in thinking that I will have to make one service for each status query I wish to undertake given that the target input may only be used once?

Best regards
Stephen

You could simplify this to a single service that you would call twice, by making the value (20 or 40) a dynamic input. If you create a hidden field on your form and map that as an input to the service then you can dynamically set the service to pull the values that match '20' and then those that match '40'.

Otherwise, your understanding is correct, in that you would have to setup 2 services one for '20' and one for '40'.