BookmarkSubscribeRSS Feed
ksulistyo
SAS Employee

Hello,

 

Is there any way in SAS VA to get value from the previous date (one day before), for example from this table:

--------------------------------------------------------
|    Date   | Company Name | Trx Value | Trx Value D-1 |
--------------------------------------------------------
| 01Jun2016 | ABC          |    10,000 |               |
| 01Jun2016 | DEF          |    11,000 |               |
| 01Jun2016 | XYZ          |    12,000 |               |
| 02Jun2016 | ABC          |    33,000 |        10,000 |
| 02Jun2016 | DEF          |    44,000 |        11,000 |
| 02Jun2016 | XYZ          |    55,000 |        12,000 |
| 03Jun2016 | ABC          |    60,000 |        33,000 |
| 03Jun2016 | DEF          |    70,000 |        44,000 |
| 03Jun2016 | XYZ          |    80,000 |        55,000 |
--------------------------------------------------------

The Trx Value D-1 is New Calculated Item that I would like to get.

 

Regards,

Karina

5 REPLIES 5
LinusH
Tourmaline | Level 20

Assuming that you mean by VA already loaded data to LASR.

I haven't worked in depth within VA, but since VA is a kind of standardized reporting tool, it works best with normalized/de-normalized data structures.

My guess is you need to fix calculations like this in the data preparation.

Data never sleeps
ksulistyo
SAS Employee

Hi Linus,

Thanks for your response.

Ok, the calculation is done in Data Preparation/Data Builder by adding new column, how does the SQL expression or the logic should look like (I attach the form)? I'm bit frustrated here 😕 

Kindly enlighten.

Thanks.


DataPrep.png
LinusH
Tourmaline | Level 20
SQL is not aware of row ordering, so any lag() or RETAIN operations isn't available here.
If you are limited to Data Builder you should be able to pull this off by doing a self join with a date = date -1 criteria.
Data never sleeps
ksulistyo
SAS Employee

Is it possible to use Periodic Operators in SAS VA?

I haven't tried it yet.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 1721 views
  • 0 likes
  • 3 in conversation