Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Improve Mondrian MDX usability with user defined functions

Presentation at Pentaho Community Meeting 2016

  • Als Erste(r) kommentieren

Improve Mondrian MDX usability with user defined functions

  1. 1. Improve Mondrian MDX usability with user defined functions Raimonds Simanovskis @rsim
  2. 2. http://github.com/rsim/mondrian-olap https://eazybi.com
  3. 3. We create a lot of calculated members….
  4. 4. Mondrian 3.x
  5. 5. Properties [Issue].CurrentMember.Properties('Created at') #ERR: mondrian.olap.fun.MondrianEvaluationException: Property 'Created at' is not valid for member '[Issue].[ABC]'
  6. 6. Properties CASE WHEN [Issue].CurrentMember.Level.Name = 'Issue' THEN [Issue].CurrentMember.Properties('Created at') END
  7. 7. Get properties [Issue].CurrentMember.get('Created at') UDF [Issue].CurrentMember.getDate('Created at') [Issue].CurrentMember.getBoolean('Resolved') [Issue].CurrentMember.getNumber('Story Points') [Issue].CurrentMember.getString('Summary')
  8. 8. Debug all properties [Issue].CurrentMember.AllProperties KEY: JSD-1 Created at: 2013-10-03 01:01:35 Updated at: 2015-07-23 10:40:12 Resolved at: 2013-10-03 01:10:39 Due date: Parent issue key: Sub-task keys: Open sub-task keys: Story Points: Closed at: Sprint: (no sprint) Epic Link: Reporter name: dcurrie@atlassian.com Assignee name: jpendleton ... UDF
  9. 9. Current hierarchy [Time].CurrentMember [Time.Weekly].CurrentMember CASE WHEN NOT [Time].CurrentMember IS [Time].DefaultMember THEN ... WHEN NOT [Time.Weekly].CurrentMember IS [Time.Weekly].DefaultMember THEN ... END
  10. 10. Current hierarchy [Time].CurrentHierarchy [Time].CurrentMember or [Time.Weekly].CurrentMember [Time].CurrentHierarchyMember [Time] or [Time.Weekly] UDF
  11. 11. Current hierarchy member properties [Issue].CurrentHierarchyMember.get('Created at') UDF
  12. 12. Current Time period CurrentDateMember([Time], '["Time"].[yyyy].["Q"q].[m].[d]') [Time].[Day].CurrentDateMember UDF
  13. 13. Date parsing DateParse('2016-11-12') DateParse('Nov 12 2016') DateParse('today') DateParse('3 months ago') DateParse('10 days from now') UDF
  14. 14. Time period start and end dates [Time].CurrentHierarchyMember.StartDate [Time].CurrentHierarchyMember.NextStartDate UDF
  15. 15. Date calculations DateCompare DateAddDays DateDiffDays DateDiffHours DateDiffMinutes DateBetween DateDiffWorkdays DateAddWorkdays DateInPeriod DateAfterPeriodEnd DateBeforePeriodEnd AnyDateInPeriod [Time].[Month].DateMember('3 months ago') UDF
  16. 16. Cumulative totals Sum( [Time].CurrentHierarchyMember.Level.Members.Item(0): [Time].CurrentHierarchyMember, expression ) Sum( PeriodsToDate([Time].[(All)], [Time].CurrentHierarchyMember), expression )
  17. 17. Cumulative totals Sum( { Generate( Ascendants([Time].CurrentHierarchyMember), IIF([Time].CurrentHierarchyMember IS [Time].CurrentHierarchyMember.FirstSibling, {}, { [Time].CurrentHierarchyMember.FirstSibling: [Time].CurrentHierarchyMember.PrevMember } ) ), [Time].CurrentHierarchyMember }, expression )
  18. 18. Cumulative totals Sum( { PreviousPeriods([Time].CurrentHierarchyMember), [Time].CurrentHierarchyMember }, expression ) UDF
  19. 19. Aggregated calculated members [Project].[A and B] = Aggregate({[Project].[A], [Project].[B]}) UDF ChildrenSet([Project].[A and B]) = {[Project].[A], [Project].[B]}
  20. 20. Default context DefaultContext( (measure, member_2) ) = (measure, member_2, default_member_3, ..., default_member_N) UDF DefaultContext( ( [Measures].[Store Sales], [Customers].CurrentMember ) )
  21. 21. https://docs.eazybi.com/display/EAZYBI/ MDX+Function+Reference https://github.com/rsim/mondrian_udf

    Als Erste(r) kommentieren

    Loggen Sie sich ein, um Kommentare anzuzeigen.

  • freejoe

    Jul. 7, 2017
  • ManuelAlgara

    Feb. 9, 2018

Presentation at Pentaho Community Meeting 2016

Aufrufe

Aufrufe insgesamt

1.500

Auf Slideshare

0

Aus Einbettungen

0

Anzahl der Einbettungen

2

Befehle

Downloads

29

Geteilt

0

Kommentare

0

Likes

2

×