This commit is contained in:
@@ -49,15 +49,14 @@ The following tables should be created in the WORK library as outputs:
|
||||
This output table can contain up to three columns:
|
||||
|
||||
* `display_index` (optional, mandatory if using `dynamic_extended_values`). Is a numeric key used to join the two tables.
|
||||
* `display_value` - always character
|
||||
* `raw_value` - unformatted character or numeric according to source data type
|
||||
|
||||
Example values:
|
||||
|
||||
|DISPLAY_INDEX:best.|DISPLAY_VALUE:$|RAW_VALUE|
|
||||
|---|---|---|
|
||||
|1|$77.43|77.43|
|
||||
|2|$88.43|88.43|
|
||||
|DISPLAY_INDEX:best.|RAW_VALUE|
|
||||
|---|---|
|
||||
|1|77.43|
|
||||
|2|88.43|
|
||||
|
||||
### `WORK.DYNAMIC_EXTENDED_VALUES`
|
||||
This output table is optional. If provided, it will map the DISPLAY_INDEX from the DYNAMIC_VALUES table to additional column/value pairs, that will be used to populate dropdowns for _other_ cells in the _same_ row.
|
||||
@@ -66,7 +65,6 @@ The following columns should be provided:
|
||||
|
||||
* `display_index` - a numeric key joining each value to the `dynamic_values` table
|
||||
* `extra_col_name` - the name of the additional variable(s) to contain the extra dropdown(s)
|
||||
* `display_value` - the value to display in the dropdown. Always character.
|
||||
* `display_type` - Either C or N depending on the raw value type
|
||||
* `raw_value_num` - The unformatted value if numeric
|
||||
* `raw_value_char` - The unformatted value if character
|
||||
@@ -74,17 +72,17 @@ The following columns should be provided:
|
||||
|
||||
Example Values:
|
||||
|
||||
|DISPLAY_INDEX:best.|EXTRA_COL_NAME:$32|DISPLAY_VALUE:$|DISPLAY_TYPE:$1.|RAW_VALUE_NUM|RAW_VALUE_CHAR:$5000|FORCED_VALUE|
|
||||
|---|---|---|---|---|---|---|
|
||||
|1|DISCOUNT_RT|"50%"|N|0.5||.|
|
||||
|1|DISCOUNT_RT|"40%"|N|0.4||0|
|
||||
|1|DISCOUNT_RT|"30%"|N|0.3||1|
|
||||
|1|CURRENCY_SYMBOL|"GBP"|C||"GBP"|.|
|
||||
|1|CURRENCY_SYMBOL|"RSD"|C||"RSD"|.|
|
||||
|2|DISCOUNT_RT|"50%"|N|0.5||.|
|
||||
|2|DISCOUNT_RT|"40%"|N|0.4||1|
|
||||
|2|CURRENCY_SYMBOL|"EUR"|C||"EUR"|.|
|
||||
|2|CURRENCY_SYMBOL|"HKD"|C||"HKD"|1|
|
||||
|DISPLAY_INDEX:best.|EXTRA_COL_NAME:$32|DISPLAY_TYPE:$1.|RAW_VALUE_NUM|RAW_VALUE_CHAR:$5000|FORCED_VALUE|
|
||||
|---|---|---|---|---|---|
|
||||
|1|DISCOUNT_RT|N|0.5||.|
|
||||
|1|DISCOUNT_RT|N|0.4||0|
|
||||
|1|DISCOUNT_RT|N|0.3||1|
|
||||
|1|CURRENCY_SYMBOL|C||"GBP"|.|
|
||||
|1|CURRENCY_SYMBOL|C||"RSD"|.|
|
||||
|2|DISCOUNT_RT|N|0.5||.|
|
||||
|2|DISCOUNT_RT|N|0.4||1|
|
||||
|2|CURRENCY_SYMBOL|C||"EUR"|.|
|
||||
|2|CURRENCY_SYMBOL|C||"HKD"|1|
|
||||
|
||||
|
||||
### Code Examples
|
||||
@@ -107,9 +105,9 @@ Simple dropdown
|
||||
Output should be a single table called
|
||||
"work.dynamic_values" in the format below.
|
||||
|
||||
|DISPLAY_VALUE:$|RAW_VALUE:??|
|
||||
|---|---|
|
||||
|$44.00|44|
|
||||
|RAW_VALUE:??|
|
||||
|---|
|
||||
|44|
|
||||
|
||||
**/
|
||||
|
||||
@@ -133,37 +131,33 @@ create table work.source as
|
||||
where tx_to > "%sysfunc(datetime(),E8601DT26.6)"dt
|
||||
order by 1,2;
|
||||
|
||||
data work.DYNAMIC_VALUES (keep=display_index raw_value display_value);
|
||||
data work.DYNAMIC_VALUES (keep=display_index raw_value);
|
||||
set work.source end=last;
|
||||
by libref;
|
||||
if last.libref then do;
|
||||
display_index+1;
|
||||
raw_value=libref;
|
||||
display_value=libref;
|
||||
output;
|
||||
end;
|
||||
if last then do;
|
||||
display_index+1;
|
||||
raw_value='*ALL*';
|
||||
display_value='*ALL*';
|
||||
output;
|
||||
end;
|
||||
run;
|
||||
|
||||
data work.dynamic_extended_values(keep=display_index extra_col_name display_type
|
||||
display_value RAW_VALUE_CHAR raw_value_num forced_value);
|
||||
RAW_VALUE_CHAR raw_value_num forced_value);
|
||||
set work.source end=last;
|
||||
by libref dsn;
|
||||
retain extra_col_name 'ALERT_DS';
|
||||
retain display_type 'C';
|
||||
retain raw_value_num .;
|
||||
raw_value_char=dsn;
|
||||
display_value=dsn;
|
||||
forced_value=0;
|
||||
|
||||
if first.libref then display_index+1;
|
||||
if last.libref then do;
|
||||
display_value='*ALL*';
|
||||
raw_value_char='*ALL*';
|
||||
forced_value=1;
|
||||
output;
|
||||
@@ -171,7 +165,6 @@ data work.dynamic_extended_values(keep=display_index extra_col_name display_type
|
||||
else output;
|
||||
|
||||
if last then do;
|
||||
display_value='*ALL*';
|
||||
raw_value_char='*ALL*';
|
||||
forced_value=1;
|
||||
output;
|
||||
|
||||
Reference in New Issue
Block a user