cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AGS94
Level 8

Adding and Filtering Numeric Columns in a Collection

Referring to the attached JPG, I am trying to to do two things:

1) Add numeric columns to a collection (no matter what I have tried they always show up as text)

2) Filter by the GrpAll column

 

I created columns GrpCol, GrpFst and GrpMat and set them = 1 (not "1") when the respective Color, Fastener and/or Material is selected from a checkbox. I also set them to = 0 when the respective box is unchecked. I then created the GrpAll column by taking the average of these three columns (I am doing all of this to set up subsequent filtering).

 

As you can see, it is working up to this point, but as soon as I filter the GrpAll, the fractions all turn to 1, thus defeating the purpose. Also, oddly if I filter by any of the other three "Grp" columns, some fo the GrpAll fractions flip to 1 and some do not (ex. some 0.3333 remain 0.3333, but some change to 1).

 

What am I doing wrong?Capture.JPGCapture2.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
AGS94
Level 8

Re: Adding and Filtering Numeric Columns in a Collection

Finally got the Max() formula figured out. Problem solved.

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: Adding and Filtering Numeric Columns in a Collection

Two things

1) Can you explain a bit more about how you are doing the calculation that gets added to the collection?  I was able to setup a static collection with numeric fields and had no issues.  I suspect there is some interaction  between the way you are calculating and saving the values that is causing the problem.

2) Rather than working with the averages why not just Sum the columns?  The ranking would be the same, but then you are working with integers not whole number fractions.  If the issue is rounding then that would no longer be an issue.  

 

But I suspect the issue is inolved with the Checkboxes.  Those generate a true false value that can be interpreted as 1/0, but it isn't actually the same as an integer.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
AGS94
Level 8

Re: Adding and Filtering Numeric Columns in a Collection

Following is the formula that adds the GrpAll column. I had changed to sum vs average shortly after my original post for the reasons you mention. I have been trying to use Value() everywhere possible in the hopes everything would remain numeric.

 

UpdateIf(CollJak,(GrpCol+GrpFst+GrpMat)>0,{GrpAll:Value(GrpCol+GrpFst+GrpMat)})

Following is how I am adding the other "GrpXXX" columns via the OnCheck and OnUncheck for each checkbox:

 

UpdateIf(CollJak,Color="Red",{GrpCol:Value(1)})

(for OnUncheck, Value(1) is Value (""). I just added "Value" a few minutes ago hoping to "force" numeric. Previously they were simply 1 and "" (the one was without quotes). Now that I am summing, I will try changing the "" back to 0. Not sure that will help in any way.

 

I have a Data Table being populated by the CollJak collection so I can see how things are working. If I use either of the following in the Items property of the table, it will filter as expected. 

 

Filter(CollJak,GrpAll="3")

Filter(CollJak,Value(GrpAll)=3)

Of course, GrpAll could be 0,1,2 or 3 depedning on what (if any) checkboxes are selected, so I ultimately need to filter GrpAll by that column's maximum value. I have tried MAX() several different ways, but can't seem to figure it out. At this point, I am getting myself wrapped around the axle I think.

 

AGS94
Level 8

Re: Adding and Filtering Numeric Columns in a Collection

Finally got the Max() formula figured out. Problem solved.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 318 members 5,192 guests
Please welcome our newest community members: