开发者

Can I use crossjoin in WHERE statement in MDX?

开发者 https://www.devze.com 2023-03-15 23:53 出处:网络
Can I use CROSSJOIN in my WHERE statement? I need to take {[Product Attribute].[Attribute Code Number] and [Product Attribute].[Attribute] and compare them. There is a corresponding Code Number to a P

Can I use CROSSJOIN in my WHERE statement? I need to take {[Product Attribute].[Attribute Code Number] and [Product Attribute].[Attribute] and compare them. There is a corresponding Code Number to a Product Attribute and when I compare them, I SHOULD get a return such as Douglas Fir or White Pine.

Would a CROSSJOIN even help here? My current query returns Species.Douglas Fir and the boss wants the Species. portion to go away and the only way I can think to accomplish this is with the two mem开发者_运维百科bers I've listed.


Actually, you can. Take a look at the examples with Mondrian: https://github.com/rsim/mondrian-olap/blob/master/spec/query_spec.rb


CROSSJOIN is for use when you have two sets from different dimensios ON ROWS (or ON COLUMNS) and want to get every combination of the two (e.g. if one set has 2 members and the other has 3, you'll get 6 rows shown in the end).

You cannot use it in a WHERE, and I don't see a reason for using them when both sets you're joining are from the same dimension.

Perhaps you should give us an example of what results you want to see, laid out as a little table with example numbers in.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号