BookmarkSubscribeRSS Feed
anuragraishines
Quartz | Level 8

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
Quartz | Level 8

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
PROC Star

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
PROC Star

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
Quartz | Level 8

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
PROC Star

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
Quartz | Level 8

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
PROC Star

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.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1468 views
  • 0 likes
  • 3 in conversation