Calculation and filters

juergen_mueller

DaDaBIK Guru
Hello

I'm not sure whether this could be done with DaDaBik:

I have a number of tables with fields calculated by a dadabik_function. Some of this fields should be summed up. I can do that using the Pivot table option and a sql query; the results are shown by using a hook on a result page.

However, I wonder whether it's possible to calculate the sum of field depending which filter has been set in the results grid.

Could I write a function for that, or setting up a trigger or view? I'm not sure what would be the best solution for that.

Any hints are appreciated,

Juergen
 

eugenio

Administrator
Staff member
Hi Juergen,
if you want to check which search filters have been set for a table, you could check the array

PHP:
$_SESSION['advanced_filters_ar_TABLENAME']

(e.g. $_SESSION['advanced_filters_ar_customers'] for a table named "customers")

it contains info about all the filters explicitly set by the user through the quick or advanced search form. Use var_dump() to see its content, it should be clear but in case it's not, ask me.

Please note that this is not a official documented API; it has been stable for long time but it could change without notice.

Best,
 
Top