Data Treatment for negative variables

Is there a recommended data treatment on detrending negative variables? You cannot take the log of a negative value in order to use the one-sided HP filter for detrending…

On a different forum (not related to dynare), someone suggested that if the variable is always negative, you should just plug a minus in front, make the variables positive, take the log, detrend and then plug another minus in front of the cyclical component (as if you never plugged that minus in the first place).

This sounds wrong… Are there any preferable alternatives? How does one match a variable in a log-linearized model to such data?

Which variable do you have in mind. For net exports for example, you can employ the share of net exports in GDP. That will remove the trend and avoid the need to use the log.