Icon

KNIME_​challenge4_​solution

Challenge 4: Days With Price ChangesLevel: EasyDescription: You are using KNIME to monitor the daily price of a product online. After using the Line Plot node tovisualize the daily prices you have already gathered, you notice that they are often constant for a certain number ofdays before changing again. You want to create a new column in the price data you have at hand, named"Change", such that its value is 1 if a daily price changed with respect to the previous day, or 0 if it remainedunchanged. For the first daily price in the data, the "Change" value should be 1. As an example, if the initial dailyprices look like:Date Price2015-01-01 102015-01-02 102015-01-03 11You should end up with data in the following format:Date Price Change2015-01-01 10 12015-01-02 10 02015-01-03 11 1 +------------+-------+--------+| Date | Price | Change |+------------+-------+--------+| 2015-01-01 | 124.6 | 1 || 2015-01-02 | 124.6 | 0 || 2015-01-03 | 124.6 | 0 || 2015-01-04 | 124.6 | 0 || 2015-01-05 | 124.6 | 0 || 2015-01-06 | 124.6 | 0 || 2015-01-07 | 124.6 | 0 || 2015-01-08 | 124.6 | 0 || 2015-01-09 | 124.6 | 0 || 2015-01-10 | 124.6 | 0 || 2015-01-11 | 124.6 | 0 || 2015-01-12 | 124.6 | 0 || 2015-01-13 | 124.6 | 0 || 2015-01-14 | 120.4 | 1 || 2015-01-15 | 120.4 | 0 || 2015-01-16 | 120.4 | 0 |+------------+-------+--------+ Node 1Node 2Node 3Node 4Node 5Node 6 CSV Reader Line Plot String to Date&Time Lag Column Column Expressions Column Filter Challenge 4: Days With Price ChangesLevel: EasyDescription: You are using KNIME to monitor the daily price of a product online. After using the Line Plot node tovisualize the daily prices you have already gathered, you notice that they are often constant for a certain number ofdays before changing again. You want to create a new column in the price data you have at hand, named"Change", such that its value is 1 if a daily price changed with respect to the previous day, or 0 if it remainedunchanged. For the first daily price in the data, the "Change" value should be 1. As an example, if the initial dailyprices look like:Date Price2015-01-01 102015-01-02 102015-01-03 11You should end up with data in the following format:Date Price Change2015-01-01 10 12015-01-02 10 02015-01-03 11 1 +------------+-------+--------+| Date | Price | Change |+------------+-------+--------+| 2015-01-01 | 124.6 | 1 || 2015-01-02 | 124.6 | 0 || 2015-01-03 | 124.6 | 0 || 2015-01-04 | 124.6 | 0 || 2015-01-05 | 124.6 | 0 || 2015-01-06 | 124.6 | 0 || 2015-01-07 | 124.6 | 0 || 2015-01-08 | 124.6 | 0 || 2015-01-09 | 124.6 | 0 || 2015-01-10 | 124.6 | 0 || 2015-01-11 | 124.6 | 0 || 2015-01-12 | 124.6 | 0 || 2015-01-13 | 124.6 | 0 || 2015-01-14 | 120.4 | 1 || 2015-01-15 | 120.4 | 0 || 2015-01-16 | 120.4 | 0 |+------------+-------+--------+ Node 1Node 2Node 3Node 4Node 5Node 6 CSV Reader Line Plot String to Date&Time Lag Column Column Expressions Column Filter

Nodes

Extensions

Links