how to get [Time][2013].[All].[5] - mdx

I need to insert a condition into the where to display the 5th day of all the months of the year 2013
[Time][2013].[All].[5]
The All keyword doesn't work.
Anyone can help me? Thanks

Can you use the underlying fields of the hierarchy to achieve your goal? It looks like your hierarchy is made of [Time].[Year], [Time].[Month], and [Time].[Day of Month]. You could have a where clause that is ([Time].[Year].[2013], [Time].[Day of Month].[5])
You should be able to reference items in the hierarchy without denoting the entire path from the top level down. If you must use the hierarchy try something like this:
Exists({DESCENDANTS([Time].[Hierarchy].[Year].[2013], [Time].[Hierarchy].[Day of Month])},[Time].[Hierarchy].[Day of Month].[5])

Related

Is there a way in Access reports to show only one of each item but all of its attributes?

I'm not sure exactly how to explain it but basically I want to go from something like this
to this
The easiest method would be to create a report from your query, add a group to the report grouping by the Food field, and place the Food field within the group header.

How to create a sales query in SAP Business One

I would like to create a sales query for the past 12 months that can be reapplied once a month.I would like to do the whole thing with the query generator, but I can not find a table from which the sales emerge. I am familiar with the sales analysis, but I would like to simplify the whole thing. Is there a corresponding table at all or is it possible to create one?
If i understand correctly,
are you looking for .ORDR ? this is the sales order header table.
there is also .RDR1 which contains the row data.
if you go to view, then turn on 'system information' table/field details will be displayed in the bottom left.
regards,

Summing up an average column in ssrs

I need some help with trying to Totaling a column that is taking an average.
The column has an expression of: =avg(Fields!UOS_2017.Value)
I want to sum this column so I would think I could simply do: =sum(avg(Fields!UOS_2017.Value))
BUT this does not work. The total should be 3,606.
Here are my results
Here is my Design view
Update I am attached a sample of the data that is being used to create the report. Sample Data
Will anyone help me with the expression I should be using or help with a custom code. I appreciate any help.
Thank you in advance.
I'm assuming you have three row groups called something like
VP Rollup, Director Rollup and Cost Center
In this case you need to change your expression to be something like
=Sum(Avg(Fields!UOS_2017.Value, "Cost Center"))
This basically says "take the average at the cost center scope and then sum the results at the current scope (which would be at Director Rollup level).

SAP Business One I Query inventory base on user defined field

I am running a query on a product. I need a field that will look at the user defined field which contains another product and check that stock level. Any help would be great.
What is the main objective?
Are you trying to check on that item because that item is the material/component? or act like a substitution?
Using UDF is quite not feasible as you have to get the link to the Item Master Data, and I have not figured out yet how to do that.
But if you are using it as substitution, why don't you use Alternative Item in Inventory > Item Management > Alternative Items? It will show on Sales Quotation for you to display it to customer. Or during Sales Order, you can get it displayed for alternative should your main item is shortage.
If you are using those item as a component, I suggest you use Bill of Material. During Production Order you will be able to see those component's availability in qty, and also you can have more than one, unlike UDF.
Hope this helps.
I think the key part you're missing here is the naming convention which SAP adpots for user defined fields.
Correct me if I'm wrong, but it seems that you're capable of querying these fields from a SQL point of view.
UDFs by defuault, will have their column name prefixed with "U_".
For example, the UDF 'AnotherProduct' will be referred to in SQL as 'U_AnotherProduct'.
Hope this helps, if not, please explain your problem in some more detail.

Get the Attributes filter by using its display name?

I am trying to desgin a MDX query with Date filter which is an hierarchy attribute.. Now, I need to place the attribute filter value in the "where" clause.. When I drag and drop the attribute say - '2012', it gets converted to someother format like '[Date].[Fiscal Hierarchy].[Year].&[2.012E9]' whereas in leftpane display it shows as 'YR 2012'..
How do I control this conversion ? I am not sure on what basis it converts this attribute like that ?..
I need to build the MDX query dynamically in program based on the user selection.. How do I determine it is '2.012E9' when the user selectes '2012'? Or is there any way to alter the filter condition in MDX so that I can acheive this without using [2.012E9] string ?
Thanks in advance..
SELECT
[Subjects].[Name] on Rows,
[Student].Name ON COLUMNS
FROM Cube
where
[Date].[Fiscal Hierarchy].[Season].&[**2.0121E9**]
-- But the left side pane(Cube browser) shows the attribute as 'YEAR 2012'
Each member has a unique name and a display name.
In the left pane you see the display name. In the Mdx query the key of the member is used (see MSDN).
If you want to change the unique names you have to change your keys.
I am able to do this by changing the query like this:
SELECT
[Subjects].[Name] on Rows,
[Student].Name ON COLUMNS
FROM Cube
where
[Date].[Fiscal Hierarchy].[Season].[YEAR 2012]