How to evaluate expression under awk?

I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date.

Below command is used for this purpose:

cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | \
nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8) -lt $dm )&&($9=="\"unconnected") ) print $1,substr($11,2,8),$dm}' dm=$(perl -e 'use
POSIX qw(strftime); print strftime "%Y%m%d",localtime(time()- 3600*24*90);') > ${EXTRACT_FILE}

Problem is that this expression is not getting evaluated : `( substr($11,2,8) -lt $dm )`

dm=$(perl -e 'use
POSIX qw(strftime); print strftime "%Y%m%d",localtime(time()- 3600*24*90);')

results into " 20170520 " which is correct.

Please help me to get this expression evaluated and compared correctly in the command.

Duplicate post. Continue here.