Could you please tell us how would you get the result 'AccountL1- 234'? If it is not code/name, then it should be the attribute of that list (Either property/line item). So apply your formula on that property/line item and you will get your end result.
I have a numbered list 'A' with Display Name as property(text). Then the formula should be,
Test = FIND("-", 'A.Display name', 0)
Second line item Test 1 = LEFT('A.Display name',Test-1)
This is working good for Child Level, but Parent Level for 'AccountL1' is 'AccountL0' which is not a number list, for that the value is showing zero. Is there any way how we can get the parent level also populated here?
The challenge you have here is the line item is dimensioned by Account L1 and in a composite hierarchy Account L0 is a calculation
So we need to build a couple of extra line items
1. You need to know if the item is a L1 or L0, so set up a Boolean line item called Child? and set this to TRUE
2. Create another line item that brings in the Parent of the L1 - in your model it will be something like PARENT((ITEM('Account L1')). It is always best to have this in a separate line item (You will likely use it again). Remember "calculate once, reference many times"
3. Create a text line item for the name of A0, but set the summary option to 'Last non-blank'
4. This is the existing line item we just solved for
5. Now you bring it all together with a conditional and set this summary option to 'Formula'