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 254263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:49:55+00:00 2026-05-11T21:49:55+00:00

My situation is that I need to get a single value that defines the

  • 0

My situation is that I need to get a single value that defines the combination of multiple selection options. Here is a small example of what I’m looking to do.

A user is buying a shirt. There are many different options the user can select when buying the shirt. Only one option can (and must) be selected from each selection group. The selection groups could be represented as a Radio Button List or Dropdown List, anythign that only allows one selection for each group. For example:

Shirt Color: Red, Blue, Green, Black, White, or Yellow
Shirt Size: X-Small, Small, Medium, Large, X-Large, XX-Large
Shirt Design: Horizontal Striped, Vertical Stripes, Polka Dots, Diagonal Stripes, No Design
Shirt Type: Button Up Shirt, Polo Shirt, T-Shirt, Long Sleeve T-Shirt, Sweatshirt

So only one option can be selected from each group for the sake of this problem. I get a total of 900 different variations (6x6x5x5) using the possible selections. Given that the following options have the following values:

Red = 1, Blue = 2, Green = 3, Black = 4, White = 5, Yellow = 6
X-Small = 0, Small = 1, Medium = 2, Large = 3, X-Large = 4, XX-Large = 5
Horizontal Striped = 0, Vertical Stripes = 1, Polka Dots = 2, Diagonal Stripes = 3, No Design = 4
Button Up Shirt = 0, Polo Shirt = 1, T-Shirt = 2, Long Sleeve T-Shirt = 3, Sweatshirt = 4

and that a selection of {Red, X-Small, Horizontal Striped, Button Up Shirt} = 1 and {Blue, X-Small, Horizontal Striped, Button Up Shirt} = 2, etc,

What is the correct way to find the value based on the selections made? For example what should the selection value of {Black, Large, Horizontal Striped, T-Shirt} be and how do you come to the solution? I can’t quite put my finger on it and everything I’ve tried seems to have been unsuccessful. It’s probably a simple solution and I’m just brain dead right now.

  • 1 1 Answer
  • 1 View
  • 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-05-11T21:49:55+00:00Added an answer on May 11, 2026 at 9:49 pm

    You could concatenate the values of the options like they were strings (by converting each individual value to a string, concatenating them, then converting that to an integer). So, {Black, Large, Horizontal Striped, T-Shirt} would be 4302. This should guarantee that no two possible combinations have the same identifier (though I am no math whiz).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my situation. I need to create a report that shows each open
I'm in this situation that i need a list of lists. for instance i
I am in kind of situation that I need to start with a tab
Situation: I need to make an imap client (using java mail api) that if,
I have a tricky situation in trying to get information from multiple queries into
I have 2 tables that I need to get information from, and would like
I need to access multiple models from a single view. Previously, my links_controller was
I have a situation where I need to return a single collection of objects
I've found a small annoyance that I was wondering how to get around... In
I rarely come across a situation where a single table for multiple entity types

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.