Hello,
I have data that may have changed from the last run of a report. I am bringing in the old report and merging with the new run. If a datapoint changes, I would like to use proc report to add a flyover comment in the excel cell to show the previous value. I am using SAS 9.4, ODS tagsets excelxp. I know how to add the flyover comment like this:
compute mhstdat_raw;
* Cell comment;
if mhstdat_raw="09 Feb 2022" then call define(_col_, "style", "style=[background=yellow flyover='Value has changed']");
endcomp;
But, I have a lot of datapoints and the flyover needs to show the previous value which I have in the dataset. On the subject's record, I have the data variable that changed in a variable called VARIABLE and the previous value in a variable called VAL. I was hoping I could do something like this:
compute mhstdat_raw;
* Cell comment;
if variable="mhstdat_raw" then call define(_col_, "style", "style=[background=yellow flyover=val]");
endcomp;
I want to add the comment in the MHSTDAT_RAW cell with the value of VAL, but this does not work.
Any suggestions?
Thanks!
You probably will want to create a boolean variable to indicate whether or not the value has changed in a step before you call PROC REPORT to produce your pretty Excel file.
Can you show a small working example of what you are trying to do? Just enough data to demonstrate the issue.
I think I have figured this out.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.