BookmarkSubscribeRSS Feed
anuragraishines
Obsidian | Level 7

Hi All,

 

Is it possible to create lag or lead values from an aggregate field.

 

 

I am aware it can be created by using simple metric using periodic option but I have to use aggregate field to create lag, lead and avg 3 month values.

 

Regards,

Anurag

8 REPLIES 8
ehmsoleil
Fluorite | Level 6

Can you please be a little more specific and/or give an example of what you're trying to do?

anuragraishines
Obsidian | Level 7

Hi,

 

e.g.

Service_Time Sales1   Lag     Lead    Rolling_3_Months_Avg

Jan2019            10         -          20             -

Feb2019            20        10        30             -

Mar2019            30         20       40            20   

Apr2019             40        30        50           30          

May2019            50        40        -              40

 

 

I guess it will help you in understanding my requirement.

 

I know it is pretty easy to create through sas coding but here we don't have any control on data side.

This has to be created at SAS VA and base  field is an aggregate measure which we are creating at SAS VA level.

And limitation is SAS VA doesn't allow to use aggregate measure to create this logic in VA.

 

 

Regards,

Anurag Rai

 

SASKiwi
Opal | Level 21

You can run normal SAS code on SAS VA 7.x to add lag and lead columns to your data before loading into your LASR library. This could be done as part of a batch job which also loads your LASR data.  

SASKiwi
Opal | Level 21

An alternative approach could be to add a lag and lead column to each row of your source data before loading into your LASR server, then calculate aggregates from these.

anuragraishines
Obsidian | Level 7

Hi,

 

We don't have access to reporting layer else it would have been lot easy to achieve.

 

Anyways thanks for the replies.

 

 

Regards,

Anurag Rai

SASKiwi
Opal | Level 21

I'm not referring to the reporting layer, I'm talking about the data being loaded into your LASR server. Not being able to change your data sourcing if your requirements change doesn't make any sense to me.

anuragraishines
Obsidian | Level 7

Hi,

 

I got stuck in a weird situation don't have any control on data part. SAS Data builder option is also not provided.

 

 

 

Regards,

Anurag

SASKiwi
Opal | Level 21

You can use SAS Studio in SAS VA to run SAS code to prepare SAS data for loading into your LASR library. Trying to do everything in formulas / calculated measures is severely limiting as well as often being inefficient.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 1115 views
  • 0 likes
  • 3 in conversation