Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MDX: What is Set Expression in Filter function?

I'm using AdventureWorksDW2008R2 and I'm trying to create a calculated member that will only consider rows in [FactInternetSales] where [SalesAmount] > 300.

In Calculations I tried something like below, but I'm getting error MdxScript(Adventure Works DW2008R2) (8, 5) Too few arguments were passed to the FILTER function. The minimum argument count for the function is 2.:

filter(([Measures].[Sales Amount]>300))

I understand that I'm missing parameter set expression. Which would this parameter be in my example? I'm new to SSAS and MDX.

I'm creating this calculated member so that the totals I see in Excel only take into consideration rows in Fact table where [Sales Amount] > 300.

I'm also including the screenshot, maybe it helps: enter image description here

like image 358
fdkgfosfskjdlsjdlkfsf Avatar asked Jul 31 '26 14:07

fdkgfosfskjdlsjdlkfsf


1 Answers

You have to use it like this

filter([FactInternetSales],([FactInternetSales].[SalesAmount]>300))

filter takes two args, first one is table name second one is the filter needs to be applied on that table

like image 191
Asfar Irshad Avatar answered Aug 03 '26 00:08

Asfar Irshad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!