on 08-18-2016 7:50 PM
There are multiple country codes in a customer address table. I tried to calculate the score for postal codes of different countries. The rule is as
BEGIN
IF ($ctryCode='US')
BEGIN
IF (match_regex($postalCode, '^\d{5}(-\d{4})?$')) RETURN TRUE;
ELSE RETURN FALSE;
END
ELSE RETURN FALSE;
END
The script works in IBM Information Analyzer. I tested the rule in Data Insight successfully, but it seems that the result of Calculate Score is not correct, which gives the score for all countries, which is much lower than the score of US postal codes. Is there something wrong? Or should I setup something?
Appreciate for suggestions!
It's obvious IS returns the score for all countries, because it applies the rule to all records.
You can work around the issue by defining a view with $ctryCode='US' and apply the rule to the view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you use an IF statement as part of the rule then ALL data in the table you bind will be assessed. You have two options.
1. As Dirk suggested, you filter in a new DI/ database view
2. You add the country code as a filter and exclude from the rule score
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.