tforbes Posted October 19, 2008 Posted October 19, 2008 I want to create a function that works like "Countif" in Excel. For example, to count only the text value "7" in a series of cells in Excel I use: =COUNTIF(A2:Z2,7) which ignores any other text value and counts the occurrences of the value "7". In FMP how do I get the same result?
comment Posted October 19, 2008 Posted October 19, 2008 Filemaker doesn't have a built-in CountIf function. You could write a custom function using the Advanced version, but Filemaker's "native" way to deal with aggregating data is to use relationships or produce a sub-summarized report.
bruceR Posted October 20, 2008 Posted October 20, 2008 I want to create a function that works like "Countif" in Excel. For example, to count only the text value "7" in a series of cells in Excel I use: =COUNTIF(A2:Z2,7) which ignores any other text value and counts the occurrences of the value "7". In FMP how do I get the same result? ValueCount( FilterValues( List( relation::Field); "7"))
tforbes Posted November 2, 2008 Author Posted November 2, 2008 I have now used it several times. Awesome! Here is the syntax where is the field: ValueCount(FilterValues((Grade);"7"))
David Jondreau Posted November 2, 2008 Posted November 2, 2008 ValueCount( FilterValues( List( relation::Field); "7")) That's pretty nifty!
comment Posted November 2, 2008 Posted November 2, 2008 It is an elegant solution for the given example - but it's not a true CountIf(). It only works when the test is for equality (CountSimilar?).
Coriolan_66 Posted September 23, 2009 Posted September 23, 2009 ValueCount( FilterValues( List( relation::Field); "7")) works great for static values (eg. words and strings). I want to count values greather than "7". I tried something like this ValueCount( FilterValues( List( relation::Field); "relation::Field > 7")) However, it returns me "0"
comment Posted September 23, 2009 Posted September 23, 2009 I believe this was already answered in the previous posts in this thread.
Newbies bmftn Posted July 24, 2018 Newbies Posted July 24, 2018 (edited) Thank you ALL contributors to this feed! This problem has quite simply been doing my head in for a few hours. I used the following: ValueCount( FilterValues( List( RELATED TABLE I WANTED TO SEARCH::THE FIELD I WANTED TO COUNT THE NUMBER OF REPETITIONS ); THE MATCHED FIELD)) Example below: ValueCount( FilterValues( List( Car Inventory::Car Type); "Landrover")) Result: The number of records that match the car type 'Landrover' within the table inventory Edited July 24, 2018 by bmftn
Recommended Posts
This topic is 2333 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now