Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9298615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:22:00+00:00 2026-06-18T22:22:00+00:00

I am trying to define a structure that can create a one-to-many relationship, sort

  • 0

I am trying to define a structure that can create a one-to-many relationship, sort of. For example, let’s say an organization named “ACO” has some stuff:

KEY_PERF_INDS = [ {'ACO' => [2,3,4] , [2,34,5]} ]

But this is syntactically wrong. Is it possible to write something that achieves this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:22:01+00:00Added an answer on June 18, 2026 at 10:22 pm

    If your other groups HOSPITAL, BLAH, ETC (per the comments) are all to be at the same level as ACO, then the entire structure KEY_PERF_INDS should be a hash {} rather than an array []. Make each of those a key to the main hash, and each is an array containing sub-arrays.

    # The main structure is a hash {}
    KEY_PERF_INDS = { 
      'ACO' => [
        [1,2,3],
        [4,5,6]
      ], 
       'HOSPITAL' => [
        [3,2,1],
        [9,8,7]
      ],
      'BLAH' => [
        [99,88], 
        [11,22],
        [33,44]
      ]
    }
    

    Access these then as:

    KEY_PERF_INDS['HOSPITAL'][1][2]
    # prints 7
    
    KEY_PERF_INDS['BLAH'].last.first
    # prints 33
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a structure that can be dynamically added to with
Basically I am trying to build a hash structure of cstrings that I can
I'm trying to create a structure that will will be iterated across and the
I'm trying to define a method in my vb.net interface that will only accept
I am trying to define an abstract class that has operators to compare two
I'm trying to define a service endpoint in my web.config file so that I
I'm trying to define a new array through a where query but I can
I'm trying to create a map in Go that is keyed by big integers.
I am trying to design a table type structure that contains rows and cells.
I am trying to define a matrix like so I have a structure typedef

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.