web2py for (R)OLAP (pivoting)?

24 views
Skip to first unread message

Jurgis Pralgauskis

unread,
Nov 27, 2019, 3:24:39 PM11/27/19
to web2py-users
Hi, 

OLAP Cube  model is based on dimensions (what to group by) and metrics (what to aggregate). 
Dimensions are mostly categorical data -- so can be nearly any fields (mostly FK).

Metrics would be aggregations of number fields. -- But [how] could they be described (incorporated into data model)?
Does pydal support aggregate expressions (that would be grouped by  dimensions chosen in form)?

Val K

unread,
Nov 28, 2019, 12:27:29 AM11/28/19
to web2py-users

Hi !, you can pass sql expressions to select() :
.select(db.tbl.field, 'SUM(sometbl.somefield) OVER(PARTITION BY sometbl.anotherfield) AS mysum )')
Reply all
Reply to author
Forward
0 new messages