質問

I would appreciate if somebody could help me with following problem:

WITH MEMBER [Measures].[WGAlert] AS iif([Measures].[AFR]>[Measures]. [Nonconformance_GPT],1,0) 
SELECT {[Measures].[AFR],[Measures].[Nonconformance_GPT], [Measures].[WGAlert]}
ON COLUMNS, 
[dim_ProductModel].[PLA].children*[dim_ProductModel].[Warranty Group].children 
ON ROWS FROM[cub_dashboard_spares] WHERE ([dim_Date].[Date Full].&[2013-05-01])

It is a quite simple query, where I create a member WGAlert which can get a 1 if a Warranty Group's Target is smaller than AFR and 0 otherwise.

Now, I would need to "group by" these results so that I only see PLA, but not Warranty Groups. However, if I remove [Warranty Grop].children part from my query, then I would get 1s and 0s only for PLA level and not Warranty Group. (Each WG can belong to just one PLA)

Could anybody help me please, how to rewrite/group by this query?

Thank you very much,

Peter

役に立ちましたか?

解決

Not sure to understand the question but if you remove the WG from the SELECT then you're going to see WGAlert for each PLA children and the WG default member. What would you like to see if this is not what you want?

[edit from Peter comment] you might try that calc. measure :

with member [alerts] as
  count( 
    filter( 
      [dim_ProductModel].[PLA].currentMember * [dim_ProductModel].[Warranty Group].children,
      [Measures].[AFR] > [Measures]. [Nonconformance_GPT]
    )
  )
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top