cube structure question two measure groups not tied

greg lipman 81 Reputation points
2022-12-06T22:01:19.237+00:00

here is another tricky one

i have many insurance policies each has a weekly record with transaction date (Sunday) and two measures - premium that week and Inforce indicator = 1 if on that weekend policy still alive

on a given date i need to get the number of policies that are still alive and the total of premiums for them

so basically first i need a set of policies on that date that have inforce = 1
then for each policy i need to aggregate along time axis all premiums up that date

clearly slicing the cube can be done in subselect so that week's record is the last for each policy
here is my first humble try i use where instead of subselect:

SELECT FILTER
(
[Dim Policy].[Policy Nbr].Members,
([Txn Time].[Full Date].[2020-10-23T00:00:00],
[Measures].[Inforce]) > 0
) ON 0
FROM from [Bridger Olap All]
WHERE [Txn Time].[Full Date] -lt [Txn Time].[Full Date].[2020-10-23T00:00:00]

here i want to first get on columns all relevant policies with that (default) measure Premium

Thanks!!!!

!!!!!!!!!!!!!!! where can I find a solid pro and pay them for help?????????????!!!!!!!!!!!!!!!
on likes of upwork they are no help

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,297 questions
0 comments No comments
{count} votes

Accepted answer
  1. Alexei Stoyanovsky 3,416 Reputation points
    2022-12-07T15:09:04.967+00:00

    ...WHERE NULL:[Txn Time].[Full Date].[2020-10-23T00:00:00] looks more like it

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. greg lipman 81 Reputation points
    2022-12-08T13:40:50.973+00:00

    Alexei

    however i do have a question: what if the input date is NOT in that Txn Time table?

    say if it is a true datetime with real minutes?
    then [Txn Time].[Full Date].[2020-10-23T04:44:13] is NOT in the table
    but i still need to force inequality less than??????
    can we treat some date hierarchy as truly ordered


  2. greg lipman 81 Reputation points
    2022-12-08T17:41:41.73+00:00

    sorry i mistyped
    it is null:[Txn Time].[Hierarchy].[Full Date].&[2022-10-23T00:00:00]

    but again what i need ultimately is
    [Txn Time].[Hierarchy].[Full Date]...... < some totally random CDate()
    basically filter by CDate the piece of cube BEFORE that CDAte

    is that possible canot make it work


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.