I have a (rather complicated) SQL statement where I select data from lots of different tables, and to cope with a bad legacy data structure, I have a couple of custom colum
You cannot use ChannelValue column name in the where clause at the same select level. You will have to put this whole select in a subquery.
ChannelValue
select
select .... from ( your select query ) as innerSelect where ChannelValue > Limit * p.Percentage / 100