Filtering results from LUSID

How can I filter results returned from LUSID API calls?

 Filtering

Filtering is available as an optional parameter on numerous LUSID API end points including several "Get", "List" and "Search" calls. The filtering functionality allows you to specify a string defining the subset of results that are returned by the API call.

Filters are specified using the LUSID filter syntax. The available operators are:

eq - equals  

neq - not equals

gt - greater than

gte - greater than or equal to

lt - less than

lte - less than or equal to

in - equal to an item in an enumerated list

not - not equal to an item in an enumerated list

Queries can be compounded using the 'and' & 'or' keywords and 'true' & 'false' can be used in binary expressions. Examples of valid expressions are listed below.

Examples of valid expressions

  • eq 

    displayname eq 'MyPortfolio'

    isDerived eq true

  • neq 

    displayname neq 'MyPortfolio'

    isDerived neq true

  • lt 

    created lt 2017-02-01

    created lt 2017-02-02T18:00:00+02:12

  • lte 

    created lte 2017-02-01

    created lte 2017-02-02T18:00:00+02:12

  • gt 

    created gt 2017-02-01

    created gt 2017-02-02T18:00:00+02:12

  • gte 

    created gte 2017-02-01

    created gte 2017-02-02T18:00:00+02:12

  • in 

    displayName in 'MyPortfolio', 'MyOtherPortfolio'

  • not 

    not displayname in 'MyPortfolio', 'MyOtherPortfolio' 

Examples of compounding queries:

isDerived eq true and displayName eq 'Test2' and created eq 2017-01-01T01:01:00Z

isDerived eq true and created lt 2017-03-01

Properties

Properties can be filtered in the same way by providing a three part property key and one of the above operators. For example:

properties.Portfolio/default/Country eq 'fr'

properties.Portfolio/default/SigningDate gt 2016-01-01T01:01:01