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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:30:02+00:00 2026-05-20T14:30:02+00:00

I have struggled with this issue for several weeks. I have Googled it and

  • 0

I have struggled with this issue for several weeks. I have Googled it and have zero relevant results (which probably means I can’t figure out how to Google it – not that the answer isn’t out there!)

Assume four tables

Table 1 – templates

Template 1...  
Template 2...  
Template 3...  
Template 4...  

Table 2 – Periods

Period 1...  
Period 2...  
Period 3...  
Period 4...  

Table 3 – Type

Type 1...  
Type 2...

Table 4 – TemplateMatrix

Contains the matrix for which templates are applicable to which period and type. Most of the templates are applicable to all periods except 1 and there are specific templates for that period. Rather than create a templateMatrix record for every template for every period, I create one record for each specific period template with that periodID

EX:

PeriodID,   TypeID,  TemplateID  
1       ,   1     ,  1
2       ,   1     ,  2

and a record with a NULL for PeriodID for all other periods for their templates.

EX:

PeriodID,   TypeId, TemplateID  
NULL    ,   1,      3  
NULL    ,   2,      4

There are actually about 40 Periods and about 8 Templates and 2 types.

What I need is a view that will give me all possible Template and Period combinations- those that are expressly defined and all others.

In other words,

Period 1, Type 1, Template 1  
Period 2, Type 1, Template 2  
Period 3, Type 1, Template 3  
Period 3, Type 2, Template 4  
Period 4, Type 1, Template 3  
Period 4, Type 2, Template 4  
Period 5, Type 1, Template 3  
Period 5, Type 2, Template 4  
Period 6, Type 1, Template 3  
Period 6, Type 2, Template 4 

Worst case scenario, I could add all possible records to the matrix; however, that doesn’t seem very normalized to me since the only difference between the bulk of the records would be the Period ID.

Any ideas? I really am at my wits end.

Thanks,
John

  • 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-05-20T14:30:03+00:00Added an answer on May 20, 2026 at 2:30 pm

    You’ve struggled for weeks with a problem that could be solved by simply storing important business data directly in a table. We’re talking about, at most, around 360 rows, right? Just insert the rows. Jeez.

    The root cause of your problem is that a) you’re trying to shoehorn two predicates into one table, and b) you’re hoping to redefine what NULL means.

    PeriodID,   TypeID,  TemplateID  
    1       ,   1     ,  1
    NULL    ,   1     ,  3  
    

    You want the first row to mean something like this:

    Template [TemplateID] is used in
    period [PeriodID] for something of
    type [TypeID]

    But you want the second row to mean something like

    Template [TemplateID] is used in every
    period that hasn’t been identified by [PeriodID] in some other row
    for something of type [TypeID]

    Trying stuff like that will almost always lead to grief.

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

Sidebar

Related Questions

Have struggled with this call for a while now but i can't get it
I've struggled with this issue for the past 3 hrs and googled/SO a ton
This is a very lame question, but I have struggled with it far too
have written this little class, which generates a UUID every time an object of
Right now, I have a full screen application which spawns several full screen JFrames
I've been struggled this java problem for some hours, which i first thought was
I have some data which I am formatting like this: // ... imagine populating
I am new to programming and I have struggled with this for days and
I have struggled a lot spent quiet a lot of time but unable to
I'm pretty new to iPhone development and have struggled to find what I consider

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.