You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem with the alias on new column to filter my values.
I have a count in my custom query.
->addSelect('(COUNT(house.cats)) as numberCats')
I add a column as next :
$numberCats = new NumberColumn(
[
'id' => 'numberCats',
// => I WOULD PUT MY ALIAS HERE. Works only if I write select(count()) than previous
'field' => '(COUNT(house.cats))',
'title' => 'nb. cats',
'defaultOperator' => 'eq',
'operators' => ['eq', 'neq', 'btwe'],
'filterable' => true,
'export' => true,
'groups' => ["group1", "group2"],
'isManualField' => true,
'isAggregate' => true,
'source' => true,
]
);
I searched in others issues (#473) and I tried with the options :
'isManualField' => true,
'isAggregate' => true,
'source' => true,
but it doesn't work.
It works with the (COUNT(house.cats)) in field, but it's not clean... I have an alias, what a pity to write the same thing.
Would anyone have a solution to use the alias ?
Thank for the help !
Have a nice day.
The text was updated successfully, but these errors were encountered:
Jiizen
changed the title
The alias doesn't work to filter the added columns
The alias doesn't work to filter the added columns (aggregated column here)
Aug 9, 2019
Hello everyone.
I have a problem with the alias on new column to filter my values.
I have a count in my custom query.
->addSelect('(COUNT(house.cats)) as numberCats')
I add a column as next :
I searched in others issues (#473) and I tried with the options :
'isManualField' => true,
'isAggregate' => true,
'source' => true,
but it doesn't work.
It works with the (COUNT(house.cats)) in field, but it's not clean... I have an alias, what a pity to write the same thing.
Would anyone have a solution to use the alias ?
Thank for the help !
Have a nice day.
The text was updated successfully, but these errors were encountered: