Raw data field was not being pulled so logic was broken, added derived field raw_data_exists to sql statement, instead of pulling raw data with query. Also added logic to hide the view extended data icon on the right side of table.