My Questions:
My Process:
I'm currently trying to create a custom report of data stored in a MySQL database. Here is an hypothetical example of my table data:
Item_Name Item_Price Item_Stock Item_Timestamp
Dish Soap 3.99 25 1/1/2013 12:00am
Frogs 0.69 26 1/1/2013 12:00am
Frogs 0.69 19 1/1/2013 1:00am
Dish Soap 3.99 28 1/1/2013 1:00am
Item_Timestamp refers to the datetime of when the entry was made.
I'm attempting to use RapidMiner to do the following:
My goal is to create a report that tells me whether items are being restocked at a rate of equilibrium with demand.
In order to create a report for each unique Item_Name, I have created a RapidMiner process which loads unique Item_Name as an example set, then attempts to loop through the exampleset by using the extract macro operator which sends the Item_Name from each example to another SQL query. RapidMiner uses %{macro_name} as the syntax for the macro. My SQL query looks like:
Select Item_Name
From thisTable
Where Item_Name = %{macro_name}
The problem is that this query throws an exception, but I'm not sure why. Perhaps the problem is that %{macro_name} returns a string without the necessary quotes, but I am unsure.
My questions are:
I figured out the main problem:
My current SQL string has a syntax problems. I needed to capitalize and there should be no space before %{macro_name}
SELECT Item_Name
FROM `thisTable`
WHERE Item_Name =%{macro_name}