Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeclaredSet issue #1

Open
not-authorized opened this issue May 14, 2016 · 1 comment
Open

DeclaredSet issue #1

not-authorized opened this issue May 14, 2016 · 1 comment
Labels

Comments

@not-authorized
Copy link

Hi Tomaš, thank you very much for so helpful library!
I'm trying to recreate the following SET and still didn't find how to do it:

SET [Metrics] AS { 
   ( 
     [Metric].[Id].&[1], 
     [Measures].[Bank QLY] 
   ), 
   ( 
     [Metric].[Id].&[1], 
     [Measures].[PG AVG QLY] 
   ), 
   ( 
     [Metric].[Id].&[1], 
     [Measures].[QoQ GR QLY] 
   )
}

I was trying the following code:

metricsTuple = Mdx.Tuple();
model.Metrics.ForEach(m => metricsTuple.With(Mdx.Tuple()
   .With(Mdx.Member("Metric", "Id").WithValue(Convert.ToString(m.Id)))
   .With(Mdx.Member("Measures", GetMeasure(m)))
));
query = query.With(Mdx.DeclaredSet("CustomMetrics").As(metricsTuple));

and what I eventually have got is:

SET [Metrics] AS { 
   (
      { 
        [Metric].[Id].&[1], 
        [Measures].[Bank QLY] 
      }, 
      { 
        [Metric].[Id].&[1], 
        [Measures].[PG AVG QLY] 
      }, 
      { 
        [Metric].[Id].&[1], 
        [Measures].[QoQ GR QLY] 
      }
   )
}

Please advise,
thanks again!

@tomasmaconko
Copy link

Hello! Good to know you like the library! Thanks!

We looked at your problem and we see this one is similar to one we had as well. Looks like we mixed SET and TUPLE implementations. So TUPLE implementation is working as SET and vice-versa. What I suggest as quick workarround is to use SET for TUPLE.

I think this bug will be fixed soon, because this one is annoying...

Thanks for feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants