[TYPO3-english] TYPO3 TS userlisting: using AVG, SUM etc in select

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Sat Dec 7 10:08:22 CET 2013


Hello,

Somehow, this:

    10 = CONTENT
    10 {
       table = fe_users
       select {
         selectFields = type, SUM(tx_feuserextrafields_donation2012) AS 
total_donation
         pidInList = {$pidParticipants}
         groupBy=type
       }
       renderObj=COA
       renderObj {
         10 = TEXT
         10.field=  total_donation
       }
       wrap = <tfoot><tr><td colspan="5">Total 2012: | </td></tr></tfoot>
    }



On 06-12-13 13:39, Bert Hiddink [BENDOO e-work solutions] wrote:
> Hello Christian,
>
> Ah, thanks, I got it!!
>
> Regards,
> Bert
>
> On 06-12-13 12:00, Christian Hennecke wrote:
>> Am 06.12.13 11:47, schrieb Bert Hiddink [BENDOO e-work solutions]:
>>> Hello Christian,
>>>
>>> Thanks for your reply...
>>>
>>> On 06-12-13 11:32, Christian Hennecke wrote:
>>>
>>>> [snip]
>>>>
>>>> You could make lib.userlisting a COA and add another CONTENT object
>>>> with
>>>>
>>>> selectFields = type, SUM(tx_feuserextrafields_donation)
>>>
>>> OK but how should I render this part in order to show the total?
>>>
>>>   renderObj=COA
>>>    renderObj{
>>>
>>>      #Show total here of field tx_feuserextrafields_donation
>>>      10=TEXT
>>>      10.field=tx_feuserextrafields_donation ####?????
>>>      10.wrap =<td>|</td>
>>> ....
>>
>> Ah, sorry. You need to assign a new field name with AS:
>>
>> selectFields = type, SUM(tx_feuserextrafields_donation) AS total_donation
>>
>> and then
>>
>> renderObj=COA
>> renderObj{
>>    #Show total here of field tx_feuserextrafields_donation
>>    10=TEXT
>>    10.field= total_donation
>>    10.wrap =<td>|</td>
>>
>



More information about the TYPO3-english mailing list