What am I doing wrong??? Cannot get YTD working.
RUNNING:
With
MEMBER [measures].[YTDFees] AS
Aggregate (YTD([Date Dim].Year.CurrentMember),[Measures].[Fees])
SELECT {[Measures].[Fees],
[Measures].[YTDFees]
} ON COLUMNS,
{[DATE Dim].[Year].Children*[Date Dim].[Month].children } ON ROWS
FROM [CheckCashingView]
GETTING:
Fees YTDFees
2013 1 6230939.22 6230939.22
2013 2 7856979.01 7856979.01
2013 3 7058780.18 7058780.18
2013 4 6144556.08 6144556.08
2013 5 6704988.58 6704988.58
2013 6 6298429.00 6298429.00
Probably you didn't mark your time dimension as a "Time" dimension in the SSAS option. Go to the SSAS Solution Explorer, select your Time dimension and open this dimension. Select the name of your Time dimension in the Attributes section make sure that in the dimension properties there is a "Time" in the Type properties.
Related
I have the Formula:
(([Measures]. [QuantityPathology])/([Measures]. [QuantityPersons],
[DimPathology.Pathologies].[All])) * 100
The numerator is the measure QuantityPathology and the denominator is the QuantityPeople grouped by the member All of the hierarchy Pathologies, that is the total number of people served in that period regardless of the selected pathology.
But it does not work, since saiku analysis does not display any results, which may be doing wrong.
Modify message
Attached is an example of the formula
(([Measures], [QuantityPathology])/([Measures], [QuantityPeople],
[DimPathology.Pathologies][All])) * 100
QuantityPathology with Bronchitis year 2019 = 61
Number of people served in the year 2019 = 4569
61/4569 = 0,013350843*100
Result =1,3350843
Also avg(NumberPeople) does not work in all rows returns 1
I don't have any error in catalina.out
Thank you very much.
I am trying to create a measure which should slice the value based on only one dimension in SSAS tabular.
e.g the cube has a measure Population. and it has dimensions Country and time the data is something like:
Crty_A : 2018 :100
Crty_A : 2017 :200
Crty_B : 2018: 50
Crty_C : 2018: 25
The data in the measure should get aggreted only at country level. like when only country name is selected the data should be like:
Crty_A :300
Crty_B : 50
Crty_B : 25
But if time and the measure is selected the data should be:
2018 :100
2017 :200
2018: 50
2018: 25
is there any way this can be achieved?
You should be able to add simple SUM into your formula that sums the entire column. Save that as your measure and then when you bring the measure into the downstream application (Excel, PowerPivot, PowerBI, ETC) the slicing should already be applied to that measure based on the filters being applied. I'm assuming that you have a star schema and all the tables appropriate relationships.
Measure_Name:=SUM(TableName[Population])
I have the following profile table in my db:
Number | LastName | Year
1 | Kim | 2015
2 | Song | 2018
3 | Park | 2015
4 | Ahn | 2015
What im trying to display is list of names in year 2015, for example. The output will display names "Kim, Park and Ahn".
I have a form with the combobox and the subform of a datasheet. Whenever I clicked a year in the combobox, the names in the datasheet will change.
During creating the combobox, i use the "Find a record on my form based on the value I selected in my combobox". I used the column year that will appear on my combobox.
When i check the row source of the combobox, the query goes like this:
SELECT number, year
FROM profile;
Since, the year 2015 appeared 3 times, i need to group it. But i cannot group it if the primary key 'number' is included in the select sql. So therefore, i removed it and set the bound column to the year. However, it will not work.
Does that mean, ms access support only primary keys?
Select one arbitrary row only for each year:
SELECT
First(number),
year
FROM
profile
GROUP By
year
I have a question related to cubes with Microsoft Technologies, we have an SSAS Cube built on BIDS 2008 version, and the requirement is to group (sum) the measure quantity taking the previous twelve months and excluding some values in one dimension.
I have come up with a calculation inside the cube as follows:
CREATE MEMBER CURRENTCUBE.[Measures].[N-12]
AS Sum
(
(
Except
(
[Dim Sistema Corporativo].[Sistema Corporativo].[Id Sistema]
,{
[Dim Sistema Corporativo].[Sistema Corporativo].[Id Sistema].&[3]
,[Dim Sistema Corporativo].[Sistema Corporativo].[Id Sistema].&[4]
}
)
,lastperiods(12,
[Dim Tiempo].[Fecha].CURRENTMEMBER
)
)
,
[Measures].[importe]
)/*Lime*/,
VISIBLE = 1 ;
I get something like this:
Row Importe N-12
2011 12399121166 12399121166
01.2011 1040785565 1040785565
02.2011 1069453202 2110238768
03.2011 1359303502 3469542269
04.2011 1068266294 4537808563
05.2011 1163538168 5701346731
06.2011 1146393010 6847739741
07.2011 936369144.8 7784108886
08.2011 1000363518 8784472404
09.2011 859885351.7 9644357755
10.2011 779035206.2 10423392962
11.2011 933409920.9 11356802882
12.2011 1042318283 12399121166
2012 25162093544 22225879797
01.2012 -40878580.57 11317457020
02.2012 678706164.3 10926709982
03.2012 16323643149 10555714716
04.2012 947692878 10435141301
05.2012 1057496411 10329099544
06.2012 1103249990 10285956525
07.2012 976810086.3 10326397466
08.2012 1046738046 10372771994
09.2012 1027644991 10540531634
10.2012 1108157924 10869654352
11.2012 932832484 10869076915
12.2012 9826758631
2013 22225879797
2014 22225879797
2015 22225879797
2016 22225879797
2017 22225879797
2018 22225879797
2019 22225879797
2020 22225879797
2021 22225879797
2022 22225879797
2023 9826758631
As you can see it is doing the right thing altough the user asked me to make some tweaks:
First one is that the cube does not show anything if theres no data (identified as "importe" measure group) and as you can see it shows blank spaces for the next years (until 2023) when when there's no data for the default measure group.
Second one is that the user only wants to see data if and only if the current member has 12 previous months so for example, right now is showing info for the year 2011 but as the user said it should only display data for the year 2012 because all those months have previos 12 months and 2011 does not have 2010 data so for this I should have a null value.
is it possible to do this...???
or maybe you can suggest any other option like affecting the fact table directly and so on.
Thank you in advise guys.
To check if the current member has 12 previous month you can use an expression like this one:
IIf(Count(
NonEmpty(lastperiods(12, [Dim Tiempo].[Fecha].CURRENTMEMBER),
[Measures].[importe])
) = 12,
...,
...)
I am new to MDX and wondered if it is possible to create a query that shows a Sales amount per Year and per Month on two different axes, even if the sales date is a single dimension.
Something like:
Sales | 2010 | 2011 | Diff
---------+-----------+------------+----------
Jan | 1234,00 | 2345,10 | +80%
Feb | ...
...
EDIT: Added mondrian to tags, because there seem to be possibilities with other MDX implementations not available in mondrian.
Yes the solution is around calculated members :
Let's imagine your initial MDX looks like :
Select
{ [Calendar].[Year].[2010],[Calendar].[Year].[2011] } on 0,
{ [Calendar].[Months].members } on 1
from [Cube]
You can add a calculated member in the [Year] hierarchy :
With
Member [Calendar].[Year].[Diff] as [Calendar].[Year].[2011] / [Calendar].[Year].[2010]-1, FORMAT_STRING='percent'
Select
{ [Calendar].[Year].[2010],[Calendar].[Year].[2011], [Calendar].[Year].[Diff] } on 0,
{ [Calendar].[Months].members } on 1
from [Cube]
You can also add a more elegant and flexible solution, by using utility or statistical dimensions. Those dimension instead of holding data define transformations / functions and the output will not be exactly the one you're looking, but it's an interesting concept.
The problem can be solved with the ParallelPeriod function:
WITH MEMBER [Measures].[Einheiten Vorjahr]
AS '(ParallelPeriod([Year],1),
[Measures].[quantity])'
SELECT {[Measures].[quantity],[Measures].[Einheiten Vorjahr]} ON COLUMNS,
[date].[2010].children on rows
FROM salesorderitems