none
Embedded Object Hash RRS feed

  • Question

  • Hi All,

    I'm trying to create a custom object hash multilevel array to store user MFP statistics.   Is there an elegant way to create this object structure?

    UserMFP["UserName"].Month["MMonthName"].Print["Color"].Cost
    UserMFP["UserName"].Month["MMonthName"].Print["Color"].Count
    UserMFP["UserName"].Month["MMonthName"].Print["BW"].Cost
    UserMFP["UserName"].Month["MMonthName"].Print["BW"].Count
    UserMFP["UserName"].Month["MMonthName"].Copy["Color"].Cost
    UserMFP["UserName"].Month["MMonthName"].Copy["Color"].Count
    UserMFP["UserName"].Month["MMonthName"].Copy["BW"].Cost
    UserMFP["UserName"].Month["MMonthName"].Copy["BW"].Count

    I'm also curious how to make autocalculating subtotals at the user level (totaling the values from each month).


    • Edited by ScHAwake Tuesday, March 13, 2018 8:09 AM
    • Moved by Bill_Stewart Tuesday, May 8, 2018 7:05 PM Unanswerable drive-by question
    Tuesday, March 13, 2018 5:14 AM

All replies

  • What do you need it for at the end?

    Maybe there is an easier solution to do that.

    Tuesday, March 13, 2018 12:49 PM
  • To easily create a complex hash.

    $hash = @{
        Name1 = @{
            Subname1 = @{
                SubSubName = 123
                ...
                }
                ...
        }
    }
    
    First design your hash then clone it an load as needed.



    \_(ツ)_/



    • Edited by jrv Tuesday, March 13, 2018 3:22 PM
    Tuesday, March 13, 2018 3:20 PM