LEAD Function in MDX

131
6326
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


131 COMMENTS

  1. SLOTJOINT CASINO gives 100 free spins no deposit on Book of Dead to all new players that sign up with our links The Bank of Canada announced Wednesday it would hold its key overnight rate at 4.5 per cent after eight consecutive interest rate increases – and experts said the pause could last throughout 2023 as the bank watches the economy responds to its policy moves so far. IZZI Casino50 Free Spins No Deposit This bonus is only valid for all new players signing up with our links We have mentioned and identified some top free spins bonuses. But it is important to know what they are and why they are offered by online casinos. Free spins bonuses are promotions that offer players free shots at a slot jackpot. This does not require a financial commitment as a wager. They are often offered by casinos to get new players to register or deposit with them. They are also used to promote new games.
    http://xn--om3bn4fo9du3atid.kr/bbs/board.php?bo_table=free&wr_id=19713
    No matter what online casino game you enjoy, we have something for you. At SlotsLV, it’s crucial to be able to meet the expectations of every type of player that likes online casinos. This is why we have put a lot of effort into make our games selection diverse enough. Along with the amazing selection of slot machines, Slots.LV has also included other types of casino games that are also extremely popular and preferred by those who want to wager funds and stick to the gambling network online. If you think places such as Vegas are immune to it, think again.  For one thing, right in Downtown Vegas, two well-known Slot Boxes are La Bayou and Mermaids.  These locations are popular for having a unique theme, unique snacks and drinks, as well as a total party atmosphere.  It’s true that these two, “Casinos,” thrive because of the Fremont Street Experience traffic (and I’d be lying if I said I never played at them) but even outside of these high traffic zones, there is the Dotty’s chain which is a thriving enterprise closely comparable to West Virginia’s parlors.  They are also a huge thorn in the side of Station Casinos.

  2. dapoxetine generic in india [url=https://dapoxetinepriligy.foundation/]dapoxetine online purchase india[/url] buy cheap priligy online

  3. I’m tired of websites advertising ‘cheap’ [url=http://esynthroid.com/]generic Synthroid online[/url], only to scam you out of your money.

  4. Men who struggle with maintaining an erection should consider [url=https://tadalafil.foundation/]tadalafil tablets 40mg[/url] as an option.

  5. Stylist Color Pro — это блестящий салонный уровень окрашивания в домашних условиях! ТД АзимутТрейд компания по продаже сырья для производства полимерных изделий (специализация: купить азофоску, купить едкий… Отзывы о Kerastase Маска Resistance Extentioniste для усиления прочности волос в процессе их роста 8 (499) 734-17-59 Сильное средство против старения. Стимулирует обновление клеток. Увлажняет кожу, обеспечивая эластичность. Легкая эмульсия. Отзывы о ChocoLatte Масло-бальзам для волос ФОРМУЛА №3 для сухих ломких и поврежденных волос Приобрела для мамы Нано Ботокс, и не столько для лица, сколько для области шеи и декольте, ведь именно эти зоны выдают истинный возраст женщины. Конечно, мама использует эту сыворотку и для лица тоже, но реже, т.к. кожа лица у неё была более гладкая. Ну, а теперь, благодаря Нано Ботокс, и шея, и грудь стали «соответствовать» гладкому лицу. Сыворотка реально работает!
    http://farmtable.kr/bbs/board.php?bo_table=free&wr_id=16420
    Судя по отзывам о наращивании ресниц, прием витаминов А и Е ускоряет процесс восстановления. Их можно принимать в виде таблеток или добавлять в масляные комплексы для наружного использования. Через сколько восстанавливаются ресницы после наращивания, если каждый вечер смазывать ресничный край соком алоэ? Отзывы сообщают, что среднее время полного восстановления выпавших ресниц – около трех недель. Ускорить процесс помогают только специальные средства для восстановления ресниц после наращивания, ламинирования, окрашивания. Девушки всегда стремятся преобразиться. Мы наращиваем волосы, ногти и ресницы, делаем татуаж и всевозможные косметологические процедуры, которые зачастую могут обернуться для нас не самыми приятными последствиями. В частности предлагаем рассмотреть, как восстановить ресницы после наращивания в домашних условиях. Наконец, грубое снятие ресниц своими силами наносит серьезный ущерб, особенно если речь о применении ножниц, попытках выдергивать волокно. В ситуациях, когда нет другого выбора, и клиенту приходится снимать ресницы дома, выручает кремовый ремувер Enigma Home Care. Препарат разработан специально для экстренных случаев, когда попасть на снятие к мастеру не удается.

  6. how much is amitriptyline [url=http://amitriptyline.ink/]amitriptyline 100 mg tablet price[/url] buy amitriptyline online uk

  7. De klassieke gokkasten zoals de Simply Wild uit het cafe, de kroeg en de speelhal vind je nu gewoon online. Wellicht weet je nog goed hoe je de slots kunt spelen of wil je daar weer even op oefenen. We maken het je graag gemakkelijk om online de ware klassiekers te spelen. Je vindt hier de leukste fruitautomaten en speelautomaten, die je net als poker en roulette ook gewoon gratis kunt oefenen. Zodra je de spellen weer goed onder de knie hebt kun je een storting doen en de slots om geld spelen. Hier op Casino777.nl zijn we er trots op de beste casinospellen aan te bieden die er zijn. Bij ons vind je enorm veel online spellen zoals online gokkasten en zowel virtuele als live versies van klassieke tafelspellen als blackjack, roulette en baccarat zoals je ze nog nooit gezien hebt. Mis ook de spannende promoties, bonussen en gratis spins niet waarvan je als speler in ons casino, soms zelfs gratis, profiteert. Kortom, wij bieden de ultieme online casino ervaring van Nederland!
    https://wifidb.science/wiki/Holland_casino_on
    Andere verblijven buiten dit KingsHotel kosten je vanaf € 90,00 p.p.p.n. Althans van de organisatie van Kings. Home – Poker Kennisbank – Poker Events – Dutch Classics Rozvadov Win and Become the Governor of Poker Het Kings Resort / Casino in Rozvadov is in de afgelopen jaren uitgegroeid tot het Walhalla van de Europese pokerscene. Meerdere leden van Team Pokeren.nl waren eind januari 2018 voor de eerste keer in het Tsjechische dorpje aanwezig voor de Dutch Classics. In de jaren daarna zijn we nog vaak maar het King’s Resort teruggekeerd, voor onder andere de Benelux Classics, die in 2020 voor de eerste keer werd gehouden. Op basis van onze bevindingen hebben we de onderstaande review geschreven. Win and Become the Governor of Poker De wooneenheden in dit hotel zijn voorzien van een mini koelkast bar, een persoonlijk kluisje en een vlakscherm TV met satellietkanalen. De units hebben een minibar voor self-catering, samen met een TV voor entertainment.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

− 6 = 1