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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:24:57+00:00 2026-05-15T15:24:57+00:00

I have a cube built in SSAS2008 that is built upon 2 tables –

  • 0

I have a cube built in SSAS2008 that is built upon 2 tables – Accounts and Payments.

Both tables have dimensions and measures, and it appears to be working relatively well – I can get payments for accounts broken down into dimensions for either payments or accounts, and account measures broken down into account dimensions.

What I can’t do is view measures for accounts where a relationship exists with the child payments table. For example, see the balance of all accounts that have at least 1 payment.

I understand I may need a separate cube for this, but I still can’t see how my data source would need to be configured.

I’d ideally not like/have to completely reformat the data into a fact / dimension snowflake schema, as I’m not entirely sure how to do this with the relational data I have, however any suggestions on this would be welcome.

Thanks.


Update: Bounty added due to lack of interest…

  • 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-15T15:24:58+00:00Added an answer on May 15, 2026 at 3:24 pm

    My answer takes into account that you don’t want to reformat your data into a traditional data warehouse schema. If it gets you further down the road then good for you but I suspect you’ll run into more of these problems as you grow your project. It might be worth tinkering with how you might transform the data into a star schema before you need it.

    I can suggest a few options. The first that comes to mind is to make a degenerate dimension in the accounts cube that is based on the payments fact table. The following example answers your “all accounts that have a payment” problem but this should work for similar questions. I assumed an account statement date as the last day of each calendar month so you’ll want to count payments made in each calendar month.

    create table accounts_fact
    (   account_id int not null,
        statement_date datetime not null,
        bal int not null,
        constraint acc_pk primary key (account_id, statement_date)
    )
    
    create table payments_fact
    (   account_id int not null,
        payment_date datetime not null,
        amount money not null
    )
    
    insert into accounts_fact values (1, '20100131', 100)
    insert into accounts_fact values (1, '20100228', 120)
    insert into accounts_fact values (1, '20100331', 0)
    insert into accounts_fact values (2, '20100131', 100)
    insert into accounts_fact values (2, '20100228', 20)
    insert into accounts_fact values (2, '20100331', 50)
    insert into accounts_fact values (3, '20100131', 10)
    insert into accounts_fact values (3, '20100228', 30)
    insert into accounts_fact values (3, '20100331', 50)
    
    insert into payments_fact values (1, '20100112', 50)
    insert into payments_fact values (1, '20100118', 60)
    insert into payments_fact values (1, '20100215', 70)
    insert into payments_fact values (1, '20100318', 80)
    insert into payments_fact values (1, '20100331', 90)
    
    insert into payments_fact values (2, '20100112', 50)
    insert into payments_fact values (2, '20100215', 60)
    insert into payments_fact values (2, '20100320', 70)
    
    insert into payments_fact values (3, '20100101', 50)
    insert into payments_fact values (3, '20100118', 60)
    insert into payments_fact values (3, '20100318', 70)
    
    create view dim_AccountPayments
    as
    select  acc.account_id, acc.statement_date,
            sum(case when pay.payment_date IS NULL THEN 0
                 else 1
            end) as payment_count
    from    accounts_fact acc
      left outer join payments_fact pay on acc.account_id = pay.account_id
                         and pay.payment_date >= dateadd(mm, -1, dateadd(dd, 1, acc.statement_date))
                         and pay.payment_date <= acc.statement_date
    group by acc.account_id, acc.statement_date
    
    select * from dim_AccountPayments
    

    This produces the following results:

    account_id  statement_date  payment_count
    1   2010-01-31 00:00:00.000 2
    1   2010-02-28 00:00:00.000 1
    1   2010-03-31 00:00:00.000 2
    2   2010-01-31 00:00:00.000 1
    2   2010-02-28 00:00:00.000 1
    2   2010-03-31 00:00:00.000 1
    3   2010-01-31 00:00:00.000 2
    3   2010-02-28 00:00:00.000 0
    3   2010-03-31 00:00:00.000 1
    

    It should now be a doddle to make a payments count dimension in your accounts cube. For extra points, remove the group by and sum in the view to let SSAS do the aggregation; it suited me to show the results table above. Use the view’s SQL in your data source view you don’t have create view permission in the source database.

    Option 2 would be to make payment count from the view above a measure in the accounts cube. You can do this similarly to the above solution except make your accounts fact use a view similar to dim_AccountPayments. This time you must group by all key fields and aggregate the measures in the database… Very ugly. I don’t recommend it but it is possible.

    If you go with option 1 then it’s simple enough to make a named set in the account payments dimension called ‘Made a payment this month’ which is children of all filtered to remove 0.

    I hope I understood your question. I did have to make quite a few assumptions about your data structures but I hope it’s useful.

    Good luck.

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

Sidebar

Related Questions

I have to verify that olap cube data and the data from relational tables
We have a cube that we are populating the data from the source tables.
I have a cube that I have build that has data across multiple servers.
I have a cube that has a dimension that is roughly 100,000 rows. It
I have created a cube that worked fine when deploying. After a added another
I have a customer dimension. While creating cube and defining dimensions the default attributes
I have cube in Microsoft Analysis Services with several dimensionsions and measures. When I(in
I have a cube that I access via Targit (BI Solution). When I browse
I have a SSAS cube in which there is a measure that needs to
I have a ssas cube with a customer dimension that displays special characters (chinese..etc).

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.