Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add selection criteria logic for functions #2474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 23, 2024
Merged

Add selection criteria logic for functions #2474

merged 2 commits into from
Oct 23, 2024

Conversation

jahav
Copy link
Member

@jahav jahav commented Oct 20, 2024

Implement selection criteria that are used in several other functions: SUMIF, SUMIFS, COUNTIF, COUNTIFS, AVERAGEIF, AVERAGEIFS and db functions (DAVERAGE, DCOUNT...).

This is for final removal of Tally that are only used in SUMIF/S (though COUNTIF/S and AVERAGEIF/S will likely be also fixed in same batch).

The basic logic is to try to parse the criteria text and get comparison and a typed value. After that, just match values of same type using comparisons. There are few curveballs:

  • when value is number, it also tries to convert text to a number (e.g. ">0 1/2" as criteria and value is text "24:00", the criteria is converted to >0.5 and value text is converted to 1)
  • equal and not-equal for text use wildcards (e.g. =?b matches ab, 'bb', '?b', ...)
  • empty text is sometimes compared as blank, sometimes as 0 and sometimes as empty string.

Unlike Search, this one checks that that pattern matches full text.
@jahav jahav added this to the v0.105.0 milestone Oct 20, 2024
Criteria will be used in {SUM,COUNT,AVERAGE}{IF,IFS} and database
functions.
@jahav jahav merged commit f77503d into develop Oct 23, 2024
6 checks passed
@jahav jahav deleted the add-criteria branch October 23, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant