use of org.talend.dataquality.indicators.IQRIndicator in project tdq-studio-se by Talend.
the class ModelElementIndicatorImpl method fillCategoryIndicators.
/**
* Fill the plain indicator value to the corresponding indicator's property, and fill the value to field
* 'flatIndicatorEnumList' and 'plainIndicatorUnitMap'.
*
* @param indicatorEnum
* @param indicator
*/
private void fillCategoryIndicators(IndicatorEnum indicatorEnum, Indicator indicator) {
// add indicatorEnum to flatIndicatorEnumList
if (indicatorEnum.hasChildren()) {
for (IndicatorEnum indEnum : indicatorEnum.getChildren()) {
if (this.flatIndicatorEnumList.contains(indEnum)) {
continue;
}
this.flatIndicatorEnumList.add(indEnum);
}
}
switch(indicatorEnum) {
case CountsIndicatorEnum:
CountsIndicator countsIndicator = (CountsIndicator) indicator;
this.plainIndicatorUnitMap.put(IndicatorEnum.CountsIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.CountsIndicatorEnum, countsIndicator));
// add indicatorUnit to indicatorUnitMap
this.plainIndicatorUnitMap.put(IndicatorEnum.BlankCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.BlankCountIndicatorEnum, countsIndicator.getBlankCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.DistinctCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum, countsIndicator.getDistinctCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.DuplicateCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum, countsIndicator.getDuplicateCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.RowCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, countsIndicator.getRowCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.NullCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.NullCountIndicatorEnum, countsIndicator.getNullCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.UniqueIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum, countsIndicator.getUniqueCountIndicator()));
// MOD klliu bug 13411 2010-06-03
this.plainIndicatorUnitMap.put(IndicatorEnum.DefValueCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.DefValueCountIndicatorEnum, countsIndicator.getDefaultValueIndicator()));
break;
case TextIndicatorEnum:
TextIndicator textIndicator = (TextIndicator) indicator;
this.plainIndicatorUnitMap.put(IndicatorEnum.TextIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.TextIndicatorEnum, textIndicator));
// add indicatorUnit to indicatorUnitMap
this.plainIndicatorUnitMap.put(IndicatorEnum.MinLengthIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinLengthIndicatorEnum, textIndicator.getMinLengthIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.MaxLengthIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxLengthIndicatorEnum, textIndicator.getMaxLengthIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.AverageLengthIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.AverageLengthIndicatorEnum, textIndicator.getAverageLengthIndicator()));
// MOD mzhao
this.plainIndicatorUnitMap.put(IndicatorEnum.MinLengthWithBlankIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinLengthWithBlankIndicatorEnum, textIndicator.getMinLengthWithBlankIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.MinLengthWithBlankNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinLengthWithBlankNullIndicatorEnum, textIndicator.getMinLengthWithBlankNullIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.MinLengthWithNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinLengthWithNullIndicatorEnum, textIndicator.getMinLengthWithNullIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.MaxLengthWithBlankIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxLengthWithBlankIndicatorEnum, textIndicator.getMaxLengthWithBlankIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.MaxLengthWithBlankNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxLengthWithBlankNullIndicatorEnum, textIndicator.getMaxLengthWithBlankNullIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.MaxLengthWithNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxLengthWithNullIndicatorEnum, textIndicator.getMaxLengthWithNullIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.AverageLengthWithBlankIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.AverageLengthWithBlankIndicatorEnum, textIndicator.getAvgLengthWithBlankIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.AverageLengthWithNullBlankIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.AverageLengthWithNullBlankIndicatorEnum, textIndicator.getAvgLengthWithBlankNullIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.AverageLengthWithNullIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.AverageLengthWithNullIndicatorEnum, textIndicator.getAvgLengthWithNullIndicator()));
break;
case BoxIIndicatorEnum:
BoxIndicator boxtIndicator = (BoxIndicator) indicator;
this.plainIndicatorUnitMap.put(IndicatorEnum.BoxIIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.BoxIIndicatorEnum, boxtIndicator));
this.plainIndicatorUnitMap.put(IndicatorEnum.MeanIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MeanIndicatorEnum, boxtIndicator.getMeanIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.MedianIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MedianIndicatorEnum, boxtIndicator.getMedianIndicator()));
this.fillCategoryIndicators(IndicatorEnum.RangeIndicatorEnum, boxtIndicator.getRangeIndicator());
this.fillCategoryIndicators(IndicatorEnum.IQRIndicatorEnum, boxtIndicator.getIQR());
break;
case IQRIndicatorEnum:
IQRIndicator iqrIndicator = (IQRIndicator) indicator;
this.plainIndicatorUnitMap.put(IndicatorEnum.IQRIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.IQRIndicatorEnum, iqrIndicator));
this.plainIndicatorUnitMap.put(IndicatorEnum.LowerQuartileIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.LowerQuartileIndicatorEnum, iqrIndicator.getLowerValue()));
this.plainIndicatorUnitMap.put(IndicatorEnum.UpperQuartileIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.UpperQuartileIndicatorEnum, iqrIndicator.getUpperValue()));
break;
case RangeIndicatorEnum:
RangeIndicator rangeIndicator = (RangeIndicator) indicator;
this.plainIndicatorUnitMap.put(IndicatorEnum.RangeIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.RangeIndicatorEnum, rangeIndicator));
this.plainIndicatorUnitMap.put(IndicatorEnum.MaxValueIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MaxValueIndicatorEnum, rangeIndicator.getUpperValue()));
this.plainIndicatorUnitMap.put(IndicatorEnum.MinValueIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.MinValueIndicatorEnum, rangeIndicator.getLowerValue()));
break;
case PhoneNumbStatisticsIndicatorEnum:
PhoneNumbStatisticsIndicator phoneNumbIndicator = (PhoneNumbStatisticsIndicator) indicator;
this.plainIndicatorUnitMap.put(IndicatorEnum.PhoneNumbStatisticsIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.PhoneNumbStatisticsIndicatorEnum, phoneNumbIndicator));
// add indicatorUnit to indicatorUnitMap
this.plainIndicatorUnitMap.put(IndicatorEnum.ValidPhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.ValidPhoneCountIndicatorEnum, phoneNumbIndicator.getValidPhoneCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.PossiblePhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.PossiblePhoneCountIndicatorEnum, phoneNumbIndicator.getPossiblePhoneCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.ValidRegCodeCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.ValidRegCodeCountIndicatorEnum, phoneNumbIndicator.getValidRegCodeCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.InvalidRegCodeCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.InvalidRegCodeCountIndicatorEnum, phoneNumbIndicator.getInvalidRegCodeCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.WellFormE164PhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.WellFormE164PhoneCountIndicatorEnum, phoneNumbIndicator.getWellFormE164PhoneCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.WellFormIntePhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.WellFormIntePhoneCountIndicatorEnum, phoneNumbIndicator.getWellFormIntePhoneCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.WellFormNationalPhoneCountIndicatorEnum, createPlainIndicatorUnit(IndicatorEnum.WellFormNationalPhoneCountIndicatorEnum, phoneNumbIndicator.getWellFormNationalPhoneCountIndicator()));
this.plainIndicatorUnitMap.put(IndicatorEnum.FormatFreqPieIndictorEnum, createPlainIndicatorUnit(IndicatorEnum.FormatFreqPieIndictorEnum, phoneNumbIndicator.getFormatFreqPieIndicator()));
break;
default:
this.plainIndicatorUnitMap.put(indicatorEnum, createPlainIndicatorUnit(indicatorEnum, indicator));
break;
}
}
use of org.talend.dataquality.indicators.IQRIndicator in project tdq-studio-se by Talend.
the class BoxIndicatorImpl method basicSetIQR.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetIQR(IQRIndicator newIQR, NotificationChain msgs) {
IQRIndicator oldIQR = iqr;
iqr = newIQR;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, IndicatorsPackage.BOX_INDICATOR__IQR, oldIQR, newIQR);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.talend.dataquality.indicators.IQRIndicator in project tdq-studio-se by Talend.
the class SummaryStastictisExplorerRealTest method testGetQueryMap.
/**
* Test method for {@link org.talend.dq.analysis.explore.SummaryStastictisExplorer#getQueryMap()}.
*/
@Test
public void testGetQueryMap() {
// testing code for SQL Engine here
SummaryStastictisExplorer summaryExplorerSql = new SummaryStastictisExplorer();
Analysis analysisReal = AnalysisFactory.eINSTANCE.createAnalysis();
AnalysisParameters analysisParametersReal = AnalysisFactory.eINSTANCE.createAnalysisParameters();
analysisParametersReal.setExecutionLanguage(ExecutionLanguage.SQL);
analysisReal.setParameters(analysisParametersReal);
AnalysisContext analysisContextReal = AnalysisFactory.eINSTANCE.createAnalysisContext();
DataManager dataManagerReal = SoftwaredeploymentFactory.eINSTANCE.createDataManager();
analysisContextReal.setConnection(dataManagerReal);
analysisReal.setContext(analysisContextReal);
summaryExplorerSql.setAnalysis(analysisReal);
TdColumn tdColumnReal = org.talend.cwm.relational.RelationalFactory.eINSTANCE.createTdColumn();
TdTable tdTableReal = org.talend.cwm.relational.RelationalFactory.eINSTANCE.createTdTable();
// $NON-NLS-1$
tdTableReal.setName("tableName");
tdColumnReal.setOwner(tdTableReal);
// $NON-NLS-1$
tdColumnReal.setName("id");
TdSqlDataType tdsqlReal = org.talend.cwm.relational.RelationalFactory.eINSTANCE.createTdSqlDataType();
// $NON-NLS-1$
tdsqlReal.setName("Integer");
tdColumnReal.setSqlDataType(tdsqlReal);
// test for MeanIndicator
MeanIndicator meanIndicator = IndicatorsFactory.eINSTANCE.createMeanIndicator();
meanIndicator.setAnalyzedElement(tdColumnReal);
IndicatorDefinition meanIndicatorDef = DefinitionFactory.eINSTANCE.createIndicatorDefinition();
meanIndicatorDef.setName("Mean");
meanIndicator.setIndicatorDefinition(meanIndicatorDef);
ChartDataEntity entityReal = new ChartDataEntity();
// $NON-NLS-1$
entityReal.setValue("0");
entityReal.setIndicator(meanIndicator);
summaryExplorerSql.setEnitty(entityReal);
Map<String, String> queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.isEmpty());
// test for MedianIndicator
MedianIndicator medianIndicator = IndicatorsFactory.eINSTANCE.createMedianIndicator();
medianIndicator.setAnalyzedElement(tdColumnReal);
IndicatorDefinition medianIndicatorDef = DefinitionFactory.eINSTANCE.createIndicatorDefinition();
medianIndicatorDef.setName("Median");
medianIndicator.setIndicatorDefinition(medianIndicatorDef);
entityReal.setIndicator(medianIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.size() == 1);
// test for IQRIndicator
MaxValueIndicator maxValueIndicator = IndicatorsFactory.eINSTANCE.createMaxValueIndicator();
// $NON-NLS-1$
maxValueIndicator.setValue("80");
IndicatorDefinition maxValueIndicatorDef = DefinitionFactory.eINSTANCE.createIndicatorDefinition();
maxValueIndicatorDef.setName("Maximum");
maxValueIndicator.setIndicatorDefinition(maxValueIndicatorDef);
MinValueIndicator minValueIndicator = IndicatorsFactory.eINSTANCE.createMinValueIndicator();
// $NON-NLS-1$
minValueIndicator.setValue("20");
IndicatorDefinition minValueIndicatorDef = DefinitionFactory.eINSTANCE.createIndicatorDefinition();
minValueIndicatorDef.setName("Minimum");
minValueIndicator.setIndicatorDefinition(minValueIndicatorDef);
IQRIndicator iqrIndicator = IndicatorsFactory.eINSTANCE.createIQRIndicator();
iqrIndicator.setUpperValue(maxValueIndicator);
iqrIndicator.setLowerValue(minValueIndicator);
iqrIndicator.setAnalyzedElement(tdColumnReal);
IndicatorDefinition iqrIndicatorDef = DefinitionFactory.eINSTANCE.createIndicatorDefinition();
iqrIndicatorDef.setName("Inter Quartile Range");
iqrIndicator.setIndicatorDefinition(iqrIndicatorDef);
entityReal.setIndicator(iqrIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.size() == 2);
// test for LowerQuartileIndicator
LowerQuartileIndicator lowerQuartileIndicator = IndicatorsFactory.eINSTANCE.createLowerQuartileIndicator();
lowerQuartileIndicator.setAnalyzedElement(tdColumnReal);
IndicatorDefinition lowerQuartileIndicatorDef = DefinitionFactory.eINSTANCE.createIndicatorDefinition();
lowerQuartileIndicatorDef.setName("Lower Quartile");
lowerQuartileIndicator.setIndicatorDefinition(lowerQuartileIndicatorDef);
entityReal.setIndicator(lowerQuartileIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.size() == 1);
// test for UpperQuartileIndicator
UpperQuartileIndicator upperQuartileIndicator = IndicatorsFactory.eINSTANCE.createUpperQuartileIndicator();
upperQuartileIndicator.setAnalyzedElement(tdColumnReal);
IndicatorDefinition upperQuartileIndicatorDef = DefinitionFactory.eINSTANCE.createIndicatorDefinition();
upperQuartileIndicatorDef.setName("Upper Quartile");
upperQuartileIndicator.setIndicatorDefinition(upperQuartileIndicatorDef);
entityReal.setIndicator(upperQuartileIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.size() == 1);
// test for RangeIndicator
RangeIndicator rangeIndicator = IndicatorsFactory.eINSTANCE.createRangeIndicator();
rangeIndicator.setUpperValue(maxValueIndicator);
rangeIndicator.setLowerValue(minValueIndicator);
rangeIndicator.setAnalyzedElement(tdColumnReal);
IndicatorDefinition rangeIndicatorDef = DefinitionFactory.eINSTANCE.createIndicatorDefinition();
rangeIndicatorDef.setName("Range");
rangeIndicator.setIndicatorDefinition(rangeIndicatorDef);
entityReal.setIndicator(rangeIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.size() == 2);
// test for MinValueIndicator
minValueIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(minValueIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.size() == 1);
// test for MaxValueIndicator
maxValueIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(maxValueIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.size() == 1);
// testing code for Java Engine here
analysisParametersReal.setExecutionLanguage(ExecutionLanguage.JAVA);
analysisReal.setParameters(analysisParametersReal);
summaryExplorerSql.setAnalysis(analysisReal);
// test for MeanIndicator
meanIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(meanIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.isEmpty());
// test for MedianIndicator
medianIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(medianIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.isEmpty());
// test for IQRIndicator
iqrIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(iqrIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.isEmpty());
// test for LowerQuartileIndicator
lowerQuartileIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(lowerQuartileIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.isEmpty());
// test for UpperQuartileIndicator
upperQuartileIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(upperQuartileIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.isEmpty());
// test for RangeIndicator
rangeIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(rangeIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.isEmpty());
// test for MinValueIndicator
minValueIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(minValueIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.isEmpty());
// test for MaxValueIndicator
maxValueIndicator.setAnalyzedElement(tdColumnReal);
entityReal.setIndicator(maxValueIndicator);
summaryExplorerSql.setEnitty(entityReal);
queryMap = summaryExplorerSql.getQueryMap();
Assert.assertTrue(queryMap.isEmpty());
}
use of org.talend.dataquality.indicators.IQRIndicator in project tdq-studio-se by Talend.
the class IndicatorHelper method propagateDataThresholdsInChildren.
/**
* Method "propagateDataThresholdsInChildren" will propage the data threshold to the indicator if the given
* indicator is a BoxIndicator (Otherwise, nothing is done).
*
* @param indicator an instance of BoxIndicator
*/
public static void propagateDataThresholdsInChildren(Indicator indicator) {
if (IndicatorsPackage.eINSTANCE.getBoxIndicator().equals(indicator.eClass())) {
BoxIndicator boxIndicator = (BoxIndicator) indicator;
String[] dataThreshold = IndicatorHelper.getDataThreshold(boxIndicator);
if (dataThreshold == null) {
// clear all data thresholds
final EList<Indicator> allChildIndicators = boxIndicator.getAllChildIndicators();
for (Indicator ind : allChildIndicators) {
clearDataThresholds(ind);
}
return;
}
// --- add thresholds in min and max indicators
RangeIndicator rangeIndicator = boxIndicator.getRangeIndicator();
setDataThresholds(rangeIndicator, dataThreshold);
// --- add thresholds in lower and upper quartile indicators
IQRIndicator iqr = boxIndicator.getIQR();
setDataThresholds(iqr, dataThreshold);
// --- add threholds to the mean and median indicator
setDataThreshold(boxIndicator.getMeanIndicator(), dataThreshold[0], dataThreshold[1]);
setDataThreshold(boxIndicator.getMedianIndicator(), dataThreshold[0], dataThreshold[1]);
} else if (IndicatorsPackage.eINSTANCE.getRangeIndicator().equals(indicator.eClass()) || IndicatorsPackage.eINSTANCE.getIQRIndicator().equals(indicator.eClass())) {
RangeIndicator rangeIndicator = (RangeIndicator) indicator;
String[] dataThreshold = IndicatorHelper.getDataThreshold(rangeIndicator);
if (dataThreshold == null) {
// clear all data thresholds
final EList<Indicator> allChildIndicators = rangeIndicator.getAllChildIndicators();
for (Indicator ind : allChildIndicators) {
clearDataThresholds(ind);
}
return;
}
// --- add thresholds in (min and max) or (lower and upper quartile) indicators
setDataThresholds(rangeIndicator, dataThreshold);
}
}
use of org.talend.dataquality.indicators.IQRIndicator in project tdq-studio-se by Talend.
the class SummaryStastictisExplorer method getOutRangeRowsStatement.
/**
* DOC hcheng Comment method "getOutRangeRowsStatement".
*
* @return
*/
private String getOutRangeRowsStatement() {
Double upperValue = null;
Double lowerValue = null;
if (indicator instanceof RangeIndicator) {
upperValue = ((RangeIndicator) indicator).getUpperValue().getRealValue();
lowerValue = ((RangeIndicator) indicator).getLowerValue().getRealValue();
} else if (indicator instanceof IQRIndicator) {
upperValue = ((IQRIndicator) indicator).getUpperValue().getRealValue();
lowerValue = ((IQRIndicator) indicator).getLowerValue().getRealValue();
}
String whereClause = dbmsLanguage.where() + this.columnName + dbmsLanguage.less() + lowerValue + dbmsLanguage.or() + this.columnName + dbmsLanguage.greater() + upperValue;
TdColumn column = (TdColumn) indicator.getAnalyzedElement();
return SELECT_ALL + dbmsLanguage.from() + getFullyQualifiedTableName(column) + whereClause;
}
Aggregations