How to get the latest 100 samples for mysql? thanks
Greeting, I want to find the latest 100 samples from mysql, so I set a auto increase key number and wish to get the subset with "operator: filter with range",but can not get the max of this attribute, did I miss some operator that can find max and min of attribute value ? thanks.
Best Answer
-
Hey,
you can extract the max with a Extract Macro operator and to macro calcs there. Or generate an id and use a normal filter on it.
Best,
Martin
0
Answers
-
Hey,
you can extract the max with a Extract Macro operator and to macro calcs there. Or generate an id and use a normal filter on it.
Best,
Martin
0 -
thank you , I get max vlaue I want from extract macro, which name is "maxID", than I found the "operator: filter example range" can not get the value from %{maxID}, but "operator: filter example" can work with %{maxID}, I am confused about this.
0 -
Hey,
have a look at this process, it should do the job.
~Martin
<?xml version="1.0" encoding="UTF-8"?><process version="7.4.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="7.4.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="generate_data" compatibility="7.4.000" expanded="true" height="68" name="Generate Data" width="90" x="45" y="85">
<parameter key="number_examples" value="1000"/>
<description align="center" color="transparent" colored="false" width="126">1000 Data points</description>
</operator>
<operator activated="true" class="extract_macro" compatibility="7.4.000" expanded="true" height="68" name="Extract Macro" width="90" x="179" y="85">
<parameter key="macro" value="maxExa"/>
<list key="additional_macros"/>
<description align="center" color="transparent" colored="false" width="126">Get Number of Examples</description>
</operator>
<operator activated="true" class="generate_macro" compatibility="7.4.000" expanded="true" height="82" name="Generate Macro" width="90" x="313" y="85">
<list key="function_descriptions">
<parameter key="minExa" value="eval(%{maxExa})-99"/>
</list>
<description align="center" color="transparent" colored="false" width="126">Get Numer of Examples -99</description>
</operator>
<operator activated="true" class="filter_example_range" compatibility="7.4.000" expanded="true" height="82" name="Filter Example Range" width="90" x="447" y="85">
<parameter key="first_example" value="%{minExa}"/>
<parameter key="last_example" value="%{maxExa}"/>
</operator>
<connect from_op="Generate Data" from_port="output" 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="Generate Macro" from_port="through 1" to_op="Filter Example Range" to_port="example set input"/>
<connect from_op="Filter Example Range" from_port="example set output" 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>1