i have tables which is able to support mulitiple languages for product:
create unique index t1_product(t1_seq)
t1_lang varchar2(2), -- should be en, ch,
create unique index t1_product_desc(t1_seq, t1_lang);
user request to create a report but the column in the report doesn't show t1_product_desc.t1_attr1_desc (because
different product have different number of attribute. The column name is meaningless to users, even changing column
name in information map cannot satisfy the requirement).
I have a question that whether sas report (or used stored process) is able to show the "value" of
t1_product_desc.t1_attr1_desc as a column. therefore, we can use the "value" of t1_product_desc.t1_attr1_desc as
report section (or group)
For PC, the attribute 1,2,3
CPU, RAM, Harddisk
For notebook, the attribute 1,2
The report should be:
PC (section or group level)
Notebook (section or group level)
The kind of "recode" you describe where numbers will be translated to a character string is certainly possible with PROC FORMAT.
The code below doesn't use formatting, but otherwise, shows a report similar to the one you described.
ods html file='c:\temp\dogroups.html' style=sasweb;
proc report data=sashelp.shoes nowd;
title 'Ordered by Region';
column region product inventory;
define region / group;
define product / group;
define inventory / sum;
break after region / page summarize;
ods html close;
To see the structure of SASHELP.SHOES, run a PROC CONTENTS, optionally followed by a PROC PRINT. The PROC CONTENTS will show you the variable names and labels and the PROC PRINT will show you the unsummarized data. You probably only need to show Africa and Asia regions to get an idea of what the original data looks like:
ods html file='c:\temp\shoesinfo.html';
proc contents data=sashelp.shoes;
title 'proc contents';
proc print data=sashelp.shoes;
where region in ('Africa', 'Asia');
var region product inventory sales returns subsidiary;
title 'Print of Selected Obs';
ods html close;
As for your other question about drag and drop in Web Report Studio, I'm not sure I understand your task or data well enough to say. If a user-defined format is associated with a variable or column, then Web Report Studio can display that formatted value and you should be able to display the formatted values on the report. But, the formats would have to be defined in the metadata and the formats would have to be associated with te variable before WRS would be able to use the formats.
I don't have a clear picture of what your data looks like from your description. I don't understand how your t1_product_desc.t1_attr1_desc column is used on the report. When I posted PROC REPORT code, I was thinking stored process, not Web Report Studio. When I think stored process, I think code, not drag and drop in the WRS report designer.
You might want to work with Tech Support on this, if, in fact, your question is how to do what you want within the confines of WRS, but not with a stored process. There IS a lot you can do with code, but without understanding what your data actually looks like, it's hard to come up with an equivalent example. Tech Support can look at your REAL data and help you come up with either an info map/WRS solution or a stored process solution.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.