cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ByPA
Helper I
Helper I

Countif

Hi,

 

I have 5 Text Input Control boxes, for which  I set the Format under Properties to be Numbers

 

ByPA_0-1633852575614.png

 

 

I collected the values in a collection called "RecordYears"

 

ByPA_1-1633851435328.png

 

 

If I create a context variable and Sum the NumClaims column, it is ok.

However, if I create a context variable and CountIf(RecordYears, NumClaims>0), I get an incompatible type error...

 

Since it is only 5 records, I don't think it is a delegation issue? How can I get countif to work?

 

Thanks for help!

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @ByPA,

 

As an alternative approach couldn't you convert the NumClaims to an integer by using a value function?

 

CountIf(RecordYears, Value(NumClaims) > 0)

 

View solution in original post

3 REPLIES 3
ByPA
Helper I
Helper I

I stumbled upon a workaround...by adding "" before and after the 0 but it means that the value in the text input control is a text and not a number despite setting Format under Properties to be Numbers?

 

UpdateContext({CountTotal:CountIf(RecordYears,NumClaims<>"0")});

Expiscornovus
Super User
Super User

Hi @ByPA,

 

As an alternative approach couldn't you convert the NumClaims to an integer by using a value function?

 

CountIf(RecordYears, Value(NumClaims) > 0)

 

View solution in original post

ByPA
Helper I
Helper I

 

Hi 

 

Thanks so much! Your suggestion is much better! 

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,238)