Hello Team ,
I need a help in knowing logic for getting multiple values for 1 property name ( ENB_NAME ) calculated on the some formula in return statement.
PROPERTY Names used are:
formula for calculating
ENB_NAME = 'cNum'+LTEANT_CELL_NUMBER
ENB_NAME = 'cNum'+ SEC_LTEANT_CELL_NUMBER
ENB_NAME = > cNum20
ENB_NAME = > cNum9
If you are testing based on the null value of then try below LTEANT_CELL_NUMBER /SEC_LTEANT_CELL_NUMBER then you can try below. Else you can can apply any logic based on the requirement
RETURN ENB_NAME= CASE WHEN (LTEANT_CELL_NUMBER is null) THEN 'cNum'+'LTEANT_CELL_NUMBER' WHEN ( SEC_LTEANT_CELL_NUMBER is null ) THEN 'cNum'+'SEC_LTEANT_CELL_NUMBER' END
It may be even easier to leverage the coalesce() function, which chooses the first non-null value:
RETURN 'cNum' + coalesce(LTEANT_CELL_NUMBER, SEC_LTEANT_CELL_NUMBER) as result
If this isn't what you're asking for, then you may need to provide more details as to what you're doing, an example of your data and attempted queries so far may help.
Hi Andrew ,
Thanks for your efforts.
But My case is " 1 Property name ( ENB_NAME ) needs to have 2 different values on the basis of 2 other peroperties ( LTEANT_CELL_NUMBER & SEC_LTEANT_CELL_NUMBER ) in return statement".
For example if LTEANT_CELL_NUMBER = 5 & SEC_LTEANT_CELL_NUMBER = 10 then value of should be
ENB_NAME = cNum5
ENB_NAME = cNum10
I think you need to explain more. A variable cannot have multiple values simultaneously, unless you want to represent it as a list of values. Is that what your'e after?
If you want to return one value in one situation, and another value in another situation, then you can use CASE expressions for this.
A more complete example of desired input and desired output (using Cypher, if possible!) would help.