Code formula

Hi All,

Just another simple one this time. I need to capture the code of the L0 Hospital subsidiary. I tried code(item('L0 Hospital Subsidairy')) formula in a text formatted line item i keep getting an error. i need to put the L0 code on the hospital code column to match the L3 department.

the hospital code column is text formatted. is that where I have an issue? should I change it to a list formatted line item?

Any ideas?




  • Hi @Jsdeloria21 ,

    Can you please share the blueprint view if possible?


  • Hi,

    As your model is not dimensionalised by 'L0 Hospital Subsidiary' you can't reference those items with ITEM() in the module. You would need to use correct amount of PARENT functions to get L0 level for your L3 items to get item of list L0. From this item you can then get the code with CODE() function.

  • Juding by your screenshot it looks like the module is L3 and you need L0 code which leads me to believe you have two additional levels in between (L2 and L1). You can take do something like Code(Parent(Parent(Parent(Item(L3))))) but that's definitely not best practice. I would instead recommend setting up an attributes module for your L3 level then create separate Parent line items and calculate the code off those parent line items. You can calculate this information once in your attribute module and reference as much as needed.