BookmarkSubscribeRSS Feed
vietlinh12hoa
Obsidian | Level 7

In Visual Analytics I have some calculated items like "my aggregation" which can be applied into other tables. Any way I could drag or copy those calculated items to other tables.

vietlinh12hoa_0-1622135855480.png

4 REPLIES 4
ballardw
Super User

The devil is in the details.

The answer is probably "Yes".

But we need to see both tables, or examples thereof, and what you expect the result to be.

 

Adding columns usually implies that there are one or more row identifiers to "match" on. Is that the case here?

 

 

vietlinh12hoa
Obsidian | Level 7

For example I have the old table:

vietlinh12hoa_0-1622133195360.png

and the aggregation is sum, mean, median, .... all values

 

and now the table with new column

vietlinh12hoa_1-1622133236175.png

also just take sum, mean, median, .... all values

 

I mean I can open editor and copies the formula but it won't be efficient when I have 100 aggregation calculation.

Any method drag drop calculated items from old table to the new table

ballardw
Super User

If you have two data sets sorted by the ID variable you show with only one observation per id then you can merge them with code like this:

 

data merged;
    merge dataold datanew;
    by id;
run;

Placing the new data set second means that any variables with the same name in new and old, other than the variable(s) on the BY statement, will have the values of the variables in the new data.

 

If you have more than one value of ID in each set then you may have to share more information, as in actual data, as the desired behavior may be trickier.

 

I don't understand any of your comments about means, median, sum or what have you. That doesn't have anytihing to do with "from one data to another".

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 887 views
  • 1 like
  • 2 in conversation