Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Align
alignjustified

Ir pieejamas vairākas noderīgas kopu atlases metodemetodes, ko var izmantot Laika periodu kopām ( Time sets) .

  • PeriodsToDate(Time.Year, Time.CurrentMember)
returns all periods from beginning of current member in specified level (in this example from beginning of current year) until specified member
  •   - atgriezīs visus periodus sākot no .Current member ( Tekošā rādītāja) atbilstošajā līmenī ( šajā gadījumā no tekoša gada sākuma ) lidz izvēlētajam rādītājam.
  • YTD(Time.CurrentMember)
is shorter version of the same function (abbreviation from
  • ir īsāka versija šai pašai funkcijai (saīsinājums no Year-to-date)
  • QTD(Time.CurrentMember)
returns quarter
  • atbilstoši  tā pati funkcija ceturkšņiem  -  quarter-to-date
set of members
  • rādītāju kopai
  • MTD(Time.CurrentMember)
returns
  •   funkcija mēnešiem  - month-to-date
set of members
  • rādītāju kopai
  • WTD(Time.CurrentMember)
returns
  • atgriezīs nedēļu  - week-to-date
set of membersIf you have just time dimension in your cube then you can use even shorter expressions
  • rādītāju kopu. Ja jūsu datu kubā ir tikai Laika ( Time ) dimensija, tad jūs pat varat izmantot vēl īsaku funkcijas versiju YTD(), QTD(), MTD()
and
  • un WTD()
as by default they will receive as argument current member of time dimension Time.CurrentMember. But sometimes you need to pass different argument to these functions. For example, if you would like to compare current
  • tā kā , kā noklusēto vērtību tās tāpat saņems tekošo rādītāju (  Current member ) no laika dimensijas  Time.CurrentMember.
  • Bet dažreiz ir nepieciešams padot citus rādītājus , kā neatkarīgos mainīgos šīm funkcijām.  Piemēram , ja jums nepieciešams salīdzināt tekošo  year-to-date
aggregates with
  • kopu ar  year-to-date
aggregates year ago you can use the following expression to get
  • kopu vienu gadu atpakaļ, jūs varat izmantot sekojošu definīciju, lai iegūtu  year-to-date
set for corresponding Time dimension member a year ago:
  • kopu atbilstošajam Laika ( Time) dimensijas rādītājam vienu gadu atpakaļ :
     YTD(ParallelPeriod(Time.Year, 1, Time.CurrentMember))

And if you like shorter expression you can omit current member argument here as well
  •  

    Ja vēlaties funkcijas definīciju saīsināt, tad var izlaist current member argumentu arī šajā funkcijā YTD(ParallelPeriod(Time.Year, 1)).
Most of time related functions will use Time.CurrentMember as default member argument.
If you want to get number of last periods from Time dimension then you can use LastPeriods function. For exampleLastPeriods
  • Lielākā daļai ar laika dimensiju saistītajās funkcijās izmanto  Time.CurrentMember kā noklusēto funkcijas rādītāja vērtību ( argumentu) . 
    Ja vēlaties iegūt skaitu ar pēdējiem periodien no Laika ( Time ) dimensijas, tad varat izmantot LastPeriods funkciju. Piemēram LastPeriods(3, Time.CurrentMember)

will return set with current Time member and two previous members. If you would like to get current and next two Time periods then use negative value -3 instead of 3. \\\\\\\\\\\\\\\\\\\\\\\\\\
  • ,
    kas atgriezīs kopu ar tekošo ( current ) laika (Time) rādītāju un divus iepriekšējo rādītājus vērtību. Ja Jūs vēlaties iegūt Tekošo (Current) un nākamos divus Laika periodus rādītāju vērtības , tad jš varat izmantot negatīvu vērtību -3 nevis 3.

 

Set operations

Align
alignjustified

There are several operations that you can perform on sets:

  • {set1, set2, ..., setn} returns union of two or more sets
  • Except(set1, set2) returns set1 members but removes any member that is in set2
  • Head(set, number) returns set with first number of members from original set (if number is not specified then set from the first set member is returned)
  • Tail(set, number) returns last number of members from set
  • set.Item(position) returns one member from set with specified position (starting from zero). So if you would like to get first member of set you can use expression Head(set).Item(0)Quite frequently you would like to filter set members using some condition. You can do this with Filter(set, condition). For example in this way you can filter all cities with sales larger than 1000:Filter(Customers.City.Members, Measures.Store Sales > 1000)
    Within condition expression [Customers].CurrentMember references current set member for which condition is evaluated. For example, this will return all cities which name starts with San (using MATCHES operator with regular expression)Filter(Customers.City.Members, Customers.CurrentMember.Name MATCHES 'San .*')
    Other typical function that is used in conditions is IsEmpty. This expression will return all cities which have non-empty sales amount:Filter(Customers.City.Members, NOT IsEmpty(Measures.Store Sales))
    Previously simple set to string function SetToStr was mentioned that is useful for expression testing purposes. But if you would like to format set results in customized way then you can use Generate(set, string_expression, separator_string). For example the following expression will return city names concatenated using comma where there is no sales amount recorded:Generate(
    Filter(Customers.City.Members, IsEmpty(Measures.Store Sales)),
    Customers.CurrentMember.Name, ', ') \\\\\\\\\\\\\\\\\\\\\\\\\\

 

...