Icon

Exercise 2

<p><strong>Chapter 8/Exercise 2</strong></p><p>This exercise demonstrates how to implement a CASE Switch to process data differently depending on the day of the week. This is a very common task in data warehousing.</p><p>In this example, we want to process the data as follows:</p><ul><li><p>Every <strong>Wednesday</strong>, create a <em>Box Plot</em> image of the scaled price.</p></li><li><p>No processing during <strong>the weekend</strong>.</p></li><li><p>On any other day, just filter out some columns.</p></li></ul>
Annotations and comments
  • Workflow: Chapter 8/Exercise 2 This exercise demonstrates how to implement a CASE Switch to process data differently depending on the day of the week. This is a very common task in data warehousing. In this example, we want to process the data as follows: Every Wednesday, create a Box Plot image of the scaled price. No processing during the weekend. On any other day, just filter out some columns.
  • Get today's date (execution date)
  • Creating flow variable To control CASE Switch
  • Case 1 (port 0): Saturday or Sunday - do nothing
  • Case 2 (port 1): Wednesday - create Box Plot image
  • Reading data
  • Case 3 (port 3): And other day - filter out some columns
  • Visualize distribution of scaled price
  • Active port depending on current day of the week
  • cars-85.csv
  • keep make, aspiration, stroke, compression ratio
  • Get execution date
  • Scale Price by 1/100
  • Extract Day of Week (Number)
  • write svg image
  • Convert to flow variable
  • 0, 1, or 2 depending on day of week

Nodes

Extensions

Links