#1 2015-02-26 15:33:58

zzgvh
Member
From: Stockholm
Registered: 2014-12-12
Website

Computed columns in dynamic lists

I'm struggling a bit with computed columns for dynamic list reports. The documentation is somewhat limited wink and so far I've not been very successful. For example I'd like to create a computed column from an existing date column so I can group records by month or year. I've tried to use Postgres' date_part function:

date_part('month', submission_date)

but get a "Could not tokenize" error.

So I guess I'm wondering what kind of expressions can be used when creating computed columns. A few examples would probably go a long way.

Cheers,
/GvH

Offline

#2 2015-02-26 16:19:13

Thorsten J. Krause
datenwerke
Registered: 2012-02-15
Website

Re: Computed columns in dynamic lists

Hi,

you can use any expression, but there is a trick wich the documentation does not really give away. (There is a hint in the config guide, but it doesn't really catch the eye)

Look at the file /fileserver/etc/dynamiclists/computedcolumn.cf it contains a whitelist of valid expressions. Remember to reload your configuration if you made changes.

Cheers,
Thorsten

Offline

#3 2015-02-27 11:44:48

zzgvh
Member
From: Stockholm
Registered: 2014-12-12
Website

Re: Computed columns in dynamic lists

Ah! Missed that, looked in all the other manuals tongue I also note that it seems all keywords have to be registered. The expression above wasn't good enough I realised, it had to be

date_part('month', CAST(submission_date AS DATE))

but for that to work I need this in computedcolumn.cf:

      ....
      <function>date_part</function>
      <function>cast</function>
      <function>as</function>
      <function>date</function>
   </functions>

Though it might be good to note for others using computed columns.

As usual thanks for a speedy reply!

/GvH

Offline

Board footer

Powered by FluxBB