Generate new multiple attributes!!!

Shiwaani
New Altair Community Member
There are 3 attributes namely ID LISTINGS CURRENTVALUE...I need to report for every record, LISTINGS which lies between 0.8 and 1.8 of the CURRENTVALUE.
I would hope to generate a new attribute to hold each LISTING whose value lies in the following range(0.8 to 1.8 of the CurrentValue).
Thx
I would hope to generate a new attribute to hold each LISTING whose value lies in the following range(0.8 to 1.8 of the CurrentValue).
Thx
Tagged:
0
Answers
-
Hello yes generate attribute operator is correct. The expression should be something like:
if(CURRENTVALUE>0.8&&CURRENTVALUE<1.8,LISTINGS,"")
Scott0 -
Thank you Scott for the reply,but I require the system to loop through the CurrentValue (for each record) and provide me with an array of Listings.
-Shiwaani0 -
Can you show me a piece of your example set?0
-
Dataset
ID Listing Current Value
11A ABC 600
12A DEF 400
13A GHI 800
14A JKL 200
15A MNO 1200
Range
.8*CurrentValue 1.8*CurrentValue
480 1080
320 720
640 1440
160 360
960 2160
Desired output
ID Listing Current Value NewVar1 NewVar2 NewVar3
11A ABC 600 ABC GHI
12A DEF 400 DEF ABC
13A GHI 800 GHI MNO
14A JKL 200 JKL
15A MNO 1200 MNO
0 -
ok I don't think this is the most elegant solution (and the results are transposed from what you want) but here you go:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.5.002">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.5.002" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="6.5.002" expanded="true" height="60" name="Retrieve FOO" width="90" x="45" y="75">
<parameter key="repository_entry" value="//Local Repository/FOO"/>
</operator>
<operator activated="true" class="remember" compatibility="6.5.002" expanded="true" height="60" name="Remember" width="90" x="179" y="75">
<parameter key="name" value="exampleset"/>
</operator>
<operator activated="true" class="loop_examples" compatibility="6.5.002" expanded="true" height="76" name="Loop Examples" width="90" x="313" y="75">
<process expanded="true">
<operator activated="true" class="extract_macro" compatibility="6.5.002" expanded="true" height="60" name="Extract Macro" width="90" x="45" y="30">
<parameter key="macro" value="currentvalue"/>
<parameter key="macro_type" value="data_value"/>
<parameter key="attribute_name" value="Current Value"/>
<parameter key="example_index" value="%{example}"/>
<list key="additional_macros"/>
</operator>
<operator activated="true" class="generate_macro" compatibility="6.5.002" expanded="true" height="76" name="Generate Macro" width="90" x="179" y="30">
<list key="function_descriptions">
<parameter key="lowerbound" value="eval(%{currentvalue})*0.8"/>
<parameter key="upperbound" value="eval(%{currentvalue})*1.8"/>
</list>
</operator>
<operator activated="true" class="recall" compatibility="6.5.002" expanded="true" height="60" name="Recall" width="90" x="179" y="165">
<parameter key="name" value="exampleset"/>
<parameter key="remove_from_store" value="false"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="6.5.002" expanded="true" height="76" name="Generate Attributes" width="90" x="313" y="165">
<list key="function_descriptions">
<parameter key="NewVar%{example}" value="if([Current Value]>eval(%{lowerbound})&&[Current Value]<eval(%{upperbound}),[Listing],"")"/>
</list>
</operator>
<operator activated="true" class="remember" compatibility="6.5.002" expanded="true" height="60" name="Remember (3)" width="90" x="447" y="165">
<parameter key="name" value="exampleset"/>
</operator>
<connect from_port="example set" to_op="Extract Macro" to_port="example set"/>
<connect from_op="Extract Macro" from_port="example set" to_op="Generate Macro" to_port="through 1"/>
<connect from_op="Recall" from_port="result" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_op="Remember (3)" to_port="store"/>
<portSpacing port="source_example set" spacing="0"/>
<portSpacing port="sink_example set" spacing="0"/>
<portSpacing port="sink_output 1" spacing="0"/>
</process>
</operator>
<operator activated="true" class="recall" compatibility="6.5.002" expanded="true" height="60" name="Recall (3)" width="90" x="514" y="75">
<parameter key="name" value="exampleset"/>
<parameter key="remove_from_store" value="false"/>
</operator>
<connect from_op="Retrieve FOO" from_port="output" to_op="Remember" to_port="store"/>
<connect from_op="Remember" from_port="stored" to_op="Loop Examples" to_port="example set"/>
<connect from_op="Recall (3)" from_port="result" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>0 -
Thx Scott, I was hoping for a operator based response ,yet I will give this a try.0