

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to count values in variable
Hi all.
I have a variable like this:
SET v_Identifier = 'audit_id','audit_type','audit_date';
Currently there is a 3 itemes. But this amount could be changed. So I need dynamicly count amount of items in this variable.
Could you plese give a hint how to do this?
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Accoding the your needs, different solutions can be applyed, one can be:
SubStringCount(v_Identifier,',')+1
If a post helps to resolve your issue, please accept it as a Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Accoding the your needs, different solutions can be applyed, one can be:
SubStringCount(v_Identifier,',')+1
If a post helps to resolve your issue, please accept it as a Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Peonynjmcdirect wrote:
Hi all.
I have a variable like this:
SET v_Identifier = 'audit_id','audit_type','audit_date';
Currently there is a 3 itemes. But this amount could be changed. So I need dynamicly count amount of items in this variable.
Could you plese give a hint how to do this?
To dynamically count the number of items in your variable v_Identifier
, you can use a combination of string functions. Since you're using a string that contains items separated by commas, you can split the string and count the resulting parts.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@micheledenardi thank you! this is what I need.
