-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BPARules : Add data category for columns does not work properly for Latitude and Longtitude #226
Comments
This portion of the rule as it is catches columns named 'latitude' or 'longitude' which are of decimal or double datatype and do not have a data category. It appears you have added a clause that assesses if the data category shows as 'uncategorized' but this value would be blank if it is uncategorized. No one would intentionally mark this as 'uncategorized'. Power BI Desktop shows a column as 'uncategorized' if the data category has not been set but the actual .bim file does not show 'uncategorized' so looking for 'uncategorized' would not be helpful. |
Hello, I have a column State. In Power BI Desktop I change the Data category to a wrong value, e.g. City. Then I decide to change it back to Uncategorized. TabularEditor now shows the Data Category as "Uncategorized" in the .bim model. I know this scenario is rare, but it is a rule and I believe it could check most of the possibilities. And this was a small change to the rule definition. But as you mentioned this is a PowerBI feature. However this change in the rule is not necessary and it does not take effect with the longitude and latitude issue. The origin rule does not take effect for the longitude and latitude columns at all. I made a change in parenthesis command ordering. I attached a zip file with the sample .bim model. It contains only a one table with Langitude and Longitude column. Both have Data Category set. Unfortunately origin rule still shows these columns as violating this rule. My update of the rule does not. |
Hello,
from my point of view the rule Add data category for columns does not work properly for Latitude and Longtitude columns.
I believe the issue is related with its bracket definition.
I suggest to update the rule definition by following way:
( string.IsNullOrWhitespace(DataCategory) or DataCategory.ToLower() == "uncategorized" ) and ( ( ( Name.ToLower().Contains("country") or Name.ToLower().Contains("continent") or Name.ToLower().Contains("city") ) and DataType == "String" ) or ( ( Name.ToLower() == "latitude" or Name.ToLower() == "longitude" ) and ( DataType == DataType.Decimal or DataType == DataType.Double ) ) )
I did some testing on my test dataset and it has been working fine. But I will appreciate any feedback from your side.
Regards,
Jiri
The text was updated successfully, but these errors were encountered: