Q420 |
6733.755169 |
. |
571.4417845 |
. |
363.2532938 |
. |
0 |
. |
0 |
. |
126.4904378 |
. |
18.189424 |
x=13857.20
I want to extract last in the Quarter, Quarter and year are changing dynamically. (i.e.Q320,Q420,Q120,Q220)
extract last record and add it to x.
Please explain further. I don't understand your words, and I don't see how they relate to the data you show.
everytime Quarter and year changes in Excel, i have to pickup the latest one..
if i give %let Q=Q320, then i have to pickup last record in that column and add it to another variable..instance X=18456.35..
@Cho8 wrote:
everytime Quarter and year changes in Excel, i have to pickup the latest one..
if i give %let Q=Q320, then i have to pickup last record in that column and add it to another variable..instance X=18456.35..
Show us a more complete data set, where we can see what you are talking about. Provide the data in a suitable form, which is this, and not screen captures or Excel documents.
And once we can see what you are talking about, explain the whole thing in detail so we can understand what you mean.
X | Y | Q320 | Q420 |
59.7006504 | 0 | ||
49.7784597 | 0 | 6103.478 | 6733.755 |
3.63574724 | 0 | ||
14.9677104 | 0 | 359.6202 | 571.4418 |
27.8748853 | 0 | ||
66.2676187 | 0 | 324.0891 | 363.2533 |
58.185401 | 0 | ||
3.06299373 | 0 | 38.69756 | 0 |
18.7158174 | 0 | ||
55.9166339 | 0 | 0 | 0 |
5.14737594 | 0 | ||
363.253294 | 0 | 112.9771 | 126.4904 |
The last records of every column to be added.
Quarter and year are changing everytime(for every input spreadsheet,but not x,y).
For instance %let Q1=Q320,Q2=Q420
@Cho8 , the best way to get help on this matter is to provide us the data in the desired form, rather than ignoring the request. I specifically stated what that was.
The first issue I see here is that you hide data (dates) in structure (variable names), which makes coding for this complicated.
Please supply a more complete example of your data, and show us how your intended value x is built from the start.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.