Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-18-2022 03:08 PM - edited 08-18-2022 03:12 PM
Is it possible to call a custom function in another custom function? This is an example of what i whould like to implement but i am getting errors .
CALL apoc.custom.declareFunction(
'AQI(pollutant::STRING, value::NUMBER) :: STRING',
'
RETURN CASE
WHEN $pollutant = "pm2.5" THEN return custom.aqi_2_5($value)
WHEN $pollutant = "pm10" THEN return custom.aqi_10($value)
WHEN $pollutant = "so2" THEN return custom.aqi_so2($value)
WHEN $pollutant = "no2" THEN return custom.aqi_no2($value)
WHEN $pollutant = "o3" THEN return custom.aqi_o3($value)
END
'
);
Thank you in advance.
08-18-2022 03:17 PM
Try removing the ‘return’ clause on lines 5-9. That is not needed in the case statement
All the sessions of the conference are now available online