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.

  • mikem

    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.

  • @drift hunters Change the column formatting to "List" instead of "Text" in the data source editor. Then set the list of valid choices for hospital codes. This will make it a dropdown list column.

  • @Jsdeloria21 geometry dash bloodbath Need to size and reference those items using ITEM() in the module. To get the item in list L0 it is necessary to use the correct number of PARENT functions.

  • Hi @Jsdeloria21 For the formula to work you need to have Dimension of the list(L0 Hospital Subsidiary) in the "Applies To" of that line item.

  • ulnaoperating
    edited April 9

    @gorilla tag In the data source editor, change the column formatting from "Text" to "List." Afterwards, establish the range of acceptable options for hospital codes. A drop-down list column will be created.