cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to count different value in one array

Hello all i have a SP list and i want to count how many values are in one array.

Could you help me with this question?

Thanks)

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to count different value in one array

Hi @lukas7898 ,

Do you want to count the number of "|","||","|||" in every record?

I suggest you firstly use Concatenate function to concatenate all the columns with "|","||","|||" value, then use Split to split the string to several rows, then use CountRows to count the number.

I made a similar test, my table only has three fields: value1,value2,value3.

I used this formula:

AddColumns(AddColumns(listname,"strings",Concatenate(value1,",",value2,",",value3)),"num1",CountRows(Filter(Split(strings,","),Result="|")),"num2",CountRows(Filter(Split(strings,","),Result="||")))

 

On your side, you should try:

AddColumns(
           AddColumns(yourlistname,"strings",     //replace with your listname
                      Concatenate(field1,",",field2,",",field3,....)),//fill in all your fieldnames with value "|","||","|||"
           "num1",
           CountRows(Filter(Split(strings,","),Result="|")),
           "num2",
           CountRows(Filter(Split(strings,","),Result="||")),
           "num3",
           CountRows(Filter(Split(strings,","),Result="|||"))
            )

Then num1 will be the number of "|", num2 will be the number of "||",num3 will be the number of "|||"

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: How to count different value in one array

Hi @lukas7898 ,

If you are referring to a Gallery

CountRows(GalleryName.AllItems)

For a Collection

CountRows(CollectionName)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Frequent Visitor

Re: How to count different value in one array

Thank you for your advice, i have done mistake and attached wrong icon,

If you look at excel table at the end you will see column I,II and III this columns show me how many I or II or III values are in one row and i dont know how to implement this action into Powerapps.

Really thank you for any help) 

Highlighted
Community Support
Community Support

Re: How to count different value in one array

Hi @lukas7898 ,

Do you want to count the number of "|","||","|||" in every record?

I suggest you firstly use Concatenate function to concatenate all the columns with "|","||","|||" value, then use Split to split the string to several rows, then use CountRows to count the number.

I made a similar test, my table only has three fields: value1,value2,value3.

I used this formula:

AddColumns(AddColumns(listname,"strings",Concatenate(value1,",",value2,",",value3)),"num1",CountRows(Filter(Split(strings,","),Result="|")),"num2",CountRows(Filter(Split(strings,","),Result="||")))

 

On your side, you should try:

AddColumns(
           AddColumns(yourlistname,"strings",     //replace with your listname
                      Concatenate(field1,",",field2,",",field3,....)),//fill in all your fieldnames with value "|","||","|||"
           "num1",
           CountRows(Filter(Split(strings,","),Result="|")),
           "num2",
           CountRows(Filter(Split(strings,","),Result="||")),
           "num3",
           CountRows(Filter(Split(strings,","),Result="|||"))
            )

Then num1 will be the number of "|", num2 will be the number of "||",num3 will be the number of "|||"

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,702)