LEAD Function in MDX

40
5082
LEAD Function
LEAD Function

Friends,

If you have read the article about LAG then you will easily say that LEAD is just opposite to LAG function after finished reading this article.LEAD is a Navigation Function which returns a value(member) that is N number of positions following the supplied member in the given attribute. Typical uses of this function is to navigate back or forward to N positions from the given member. PFB the syntax of LEAD function –

Member_Expression.Lead(Index)
Member_Expression - A valid Attribute Member .
Index - The number of positions we wish to navigate.

Member positions within a level are determined by the attribute hierarchy’s natural order. The numbering of the positions is zero-based. If the specified lead is zero (0), the Lead function returns the specified member. If you specified 1(One) then it will take you forward by one Member, if 2(Two) then will navigate forward by two members from the current member.

Positive Lead and Negative Lead –

If you specify a POSITIVE number as Index then it will go forward from the current member and this is called POSITIVE LEAD. Lets see an example for Positive Lead here.

Select [Date].[Fiscal].[Month].[January 2001].Lead(5) on 0

from [Adventure Works].

If you see the above query member expression is “[Date].[Fiscal].[Month].[January 2001]” and current member is “January 2001”. We have given LEAD(5) and hence it will navigate forward by FIVE members and will return “June 2001” as output if that member exists in Cube.

If you specify a NEGATIVE number as Index then it will go back from the current member and this is called NEGATIVE LEAD. Lets see an example for Negative Lead here.

Select [Date].[Fiscal].[Month].[January 2001].LEAD(-5) on 0

from [Adventure Works].

If you see the above query member expression is “[Date].[Fiscal].[Month].[January 2001]” and current member is “January 2001”. We have given LEAD(-5) and hence it will navigate back by FIVE members and will return “August 2000” as output if that member exists in Cube.

PFB screenshot which shows an example for Lead function.
LEAD Function
LEAD Function

Note – Lead looks like a simple function and not much useful one in real time scenarios but this function in combination with other functions like CLOSING PERIOD or RANGE functions will be most powerful and useful one.

Remember – Positive Lead = Negative Lag and Negative Lead = Positive Lag.

That’s it  .. Happy Coding !!

Regards,

Roopesh Babu V


40 COMMENTS

  1. For the patients, the factors most significantly associated with treatment preference were differences in time concerns, choice of dose, intercourse satisfaction, number of sexual attempts, satisfaction with erection hardness and the absence of or only minor side effects priligy canada

  2. Therefore, when VIAGRA is co-administered with alpha-blockers, patients should be stable on alpha-blocker therapy prior to initiating VIAGRA treatment and VIAGRA should be initiated at the lowest dose see WARNINGS AND PRECAUTIONS best generic cialis

  3. If the abscess formed inside a tooth then a hole is drilled into the hole to allow draining of the abscess cialis for sale online With with help of our online pharmacy it is possible to order generics of Viagra and Cialis at a bargain price in New Orleans, Louisiana of the USA

  4. One of the drug s most successful competitors, Cialis, was released in 2003, and this expensive but effective medication quickly became a heavy hitter in the list of treatment options for erectile dysfunction buy cialis online usa Add indication message here

  5. The Freda subscription box is the very first in the UK to deliver organic and natural period care to your door. Each month, you will receive 16 products of your choice including; pantyliners, night pads, day pads and tampons while fighting against period poverty around the world. There are even teen variations and a starter box. Every month, you’ll receive 4 products with a $60-$100 value. Enjoy a mix of makeup, hair care, body & skincare curated to match your beauty profile. Treat yourself and your skin by getting the best beauty box subscription out there! Use this popup to embed a mailing list sign up form. Offer incentives to customers to join and build your mailing list. Boxycharm is a monthly subscription box that sends 4-5 full-size makeup and beauty products to your door for the price of one. For just $27.99 per month, subscribers receive a box filled with products with an average value of $175. The Boxycharm subscription box includes products from both high-end and drugstore brands, making it easy to discover new favorites. Past boxes included products from major brands like Oribe, Haus Labs, and NARS. Plus, they often include unique products that you can’t find anywhere else. https://seekingmaryhudson.com/community/profile/andre9278619534 Next: Here’s How Makeup Artists Achieve Flawless Eye Shadow Looks Every Damn Time Pay: $15.00 per hour Darlings, unlock the secret to a runway-ready BRONZE, SCULPT and GLOW with my NEW! Glowgasm face palette in Nudegasm! Inspired by my globally-loved Glowgasm palettes and backstage beauty secrets, this nude makeup palette of universally-flattering, blurring, smoothing and illuminating effect shades brings instant SUPER STAR MAGIC to any makeup look for EVERYONE, EVERYWHERE! Standard delivery in 6-12 business days from despatchFinal mile delivery will be with your local postal service Your bag is empty. %2Fon%2Fdemandware.static%2F-%2FSites-masterCatalog_Pupa%2Fdefault%2Fdwc8803424%2FImmagini%2Flarge%2F040276A001_8011607302659_MakeupStoriesSpicyNudes_big_28052018142321.png Makeup by Mario The Nudes 1 is a limited edition eye palette that retails for $25.00 and contains 0.2 oz.

  6. They found that, in comparison with no screening, a single lifetime VIA screen at age 35, coupled with immediate treatment of women with positive results, resulted in a cost saving of US 39 per YLS as compared with a two visit HPV, although programmatic costs were not considered half life of lasix

  7. Accumulating evidence links pericyte failure to major brain pathologies such as stroke, Alzheimer s disease, BBB impairment, neurodegeneration and traumatic brain injury 3, 4 tamoxifen buy online Morphological evaluation and Western blot band densitometry and immunohistochemical analyses were performed by technicians who were blinded to the group assignment

  8. Compared with values for Group C, nutrient intake, hematology, clinico chemical parameters, and 24 hour urinary excretion of catecholamines and their metabolites of patient groups U, TAM, and MA were not significantly different stromectol rosacea McCune Albright syndrome MAS is classically defined by the clinical triad of fibrous dysplasia of bone FD, cafГ© au lait skin spots, and precocious puberty PP

  9. Diabetes can damage and weaken the small blood vessels within the retina When the connection between oxygen and sugar in the blood blood vessels of your retina are broken, fluid can leak from them and trigger swelling in your macula will doxycycline thin blod One study reported that alcohol promoted breast cancer cell proliferation, increased growth factor signaling, and upregulated the transcription of certain ER target genes

  10. html pharma state JPMorgan announced abruptly on Friday that it was quitting the physical commodity markets, seeking a buyer or partner to take over an operation that includes ownership of three power plants, as well as a handful of large tolling agreements stromectol order

LEAVE A REPLY

Please enter your comment!
Please enter your name here

− 1 = 1