Written by

Software Engineer at INTESIS - CHILE
Question JAQUELINE KRIEGER · Jul 3, 2017

Deepsee - Functions with Time

Hi everybody, 

I have to create a pivot that shows the result comparing the last week of the current date with the last week of the last year in the same month. I tried using the function LAG, but didn´t work.  Works only if I want to compare the months between the two years.  If someone has some idea, i will appreciatte a lot. 

Thanks.

Jaqueline Krieger

Comments

Sam Duncan · Jul 3, 2017

Hi Jaqueline,

This Developer Community post has some information that you may find useful: https://community.intersystems.com/post/deepsee-period-date-vs-same-per…

It deals specifically with comparing results for this year to date versus the same time period in the previous year, but you might be able to apply some of the same concepts when writing your MDX expressions. Let me know if you need clarification, or if this doesn't enable you to make the calculations you intend.

Best,

Sam Duncan

0
JAQUELINE KRIEGER  Jul 4, 2017 to Sam Duncan

Thanks a lot. It's very helpful this information

0
JAQUELINE KRIEGER  Jul 4, 2017 to Evgeny Shvarov

Thank you for your answer. It's also an alternative. 

0
Evgeny Shvarov · Jul 4, 2017

Hi Jaqueline,

Actually, it might be tricky to compare one week to another same week of the last year. The Same week may belong to different months for two different years. 

Anyway you may consider trying with WeekNumber function for Time dimensions having something like this (Samples, Holefoods):

0