fix(derived): do not duplicate a shadowed column in the grid payload
cols1 already holds the physical column, so appending the derived row for the same name would send it twice. The derived row is now appended only when the name is new; a shadowed column keeps the physical label and format, while its value comes from the view.
This commit is contained in:
1 parent
2d5de9a324
commit
6a1128a463
1 file changed
+5
-1
@@ -544,10 +544,14 @@ select upcase(loadtype)
|
||||
%if &derived_nobs>0 %then %do;
|
||||
%mp_getcols(work.vw_derived, outds=derived_cols_all)
|
||||
proc sql;
|
||||
/* a derived variable may shadow a physical column - that column is already
|
||||
in cols1, and adding it again would duplicate it in the grid. The
|
||||
physical row keeps its label and format; the value comes from the view. */
|
||||
create table work.derived_cols as
|
||||
select a.*
|
||||
from work.derived_cols_all a
|
||||
where a.NAME in (select NAME from work.derived_vars);
|
||||
where a.NAME in (select NAME from work.derived_vars)
|
||||
and a.NAME not in (select NAME from work.cols1);
|
||||
quit;
|
||||
data work.cols1;
|
||||
set work.cols1 work.derived_cols;
|
||||
|
||||
Reference in new issue
Block a user