india_ppi: Use "Insert/Update", make DB lookup more resilient
india_ppi: Use "Insert/Update", make DB lookup more resilient

Use "Insert / Update" as last step instead of "Table output" for the
last step. This allows us to insert new survey results only when
necessary. An edge case also covered is update existing PPI survey
results (ie: if a client's branch changed). See
http://wiki.pentaho.com/display/EAI/Insert+-+Update for more info.

Van and I chose to identify an existing survey response as one with a
matching survey_id, customer_key, and date_survey_taken. We'll confirm
this choice with Mary Jo.

Another bit that had to be changed was wrapping str_to_date() with a
call to date().

Make Database lookup step *not* pass on rows if the
customer_key/branch_key lookup fails. This prevents an error condition
from bad data, for instance, if a PPI survey result was recorded and
the "Date Survey Was Taken" response was set to a date before the
customer was added to Mifos (ie: outside the valid_from-valid_to range
in dim_customer).

mifos/bi,mifos/bi,mifos/bi