ph_filterdata PowerHome formula function
Description
Filters retrieved data in the specified Data
Retrieval Area
Syntax
ph_filterdata ( ai_dsvar, as_filter )
Argument | Description |
ai_dsvar | Integer. The data retrieval area you wish to
filter. Valid values are 1 thru 20. |
as_filter | String. The string containing the filter
critera. This string would be in the format that is typically used in a
SQL "where" clause. |
Return value
Long. Returns the number of rows that
were "filtered" out of the data retrieval area if successful. Returns -1
if ai_dsvar is not in the range of 1 thru 20. Returns -2 if the data
retrieval area is not valid. Returns -3 if the filter string (as_filter) is not
valid. Returns -4 if the
filter operation fails.
Usage
Use this function to filter data in a data
retrieval area. This is similar to specifying filter critera within the
where clause of the data retrieval areas SQL statement but allows you to
apply filters after retrieval rather than
during retrieval.
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_filterdata(1,"ddtype=8") -
Assuming data retrieval area 1 contains data from SQL "select * from dropdowns",
filters ALL rows except those where the DDTYPE column contains the value
8
• ph_filterdata(1,"lower(#2) like '%email%'") -
Filters ALL rows in data retrieval area 1 except those that contain the string
"email" in the second
column