22struct StatisticCalculation {
27const StatisticCalculation lclCalcDefinitions[] =
29 { STRID_CALC_MEAN,
"=AVERAGE(%RANGE%)" },
30 { STRID_CALC_STD_ERROR,
"=SQRT(VAR(%RANGE%)/COUNT(%RANGE%))"},
31 { STRID_CALC_MODE,
"=MODE(%RANGE%)"},
32 { STRID_CALC_MEDIAN,
"=MEDIAN(%RANGE%)"},
33 { STRID_CALC_FIRST_QUARTILE,
"=QUARTILE(%RANGE%; 1)" },
34 { STRID_CALC_THIRD_QUARTILE,
"=QUARTILE(%RANGE%; 3)" },
35 { STRID_CALC_VARIANCE,
"=VAR(%RANGE%)"},
36 { STRID_CALC_STD_DEVIATION,
"=STDEV(%RANGE%)"},
37 { STRID_CALC_KURTOSIS,
"=KURT(%RANGE%)"},
38 { STRID_CALC_SKEWNESS,
"=SKEW(%RANGE%)"},
39 { STRID_CALC_RANGE,
"=MAX(%RANGE%)-MIN(%RANGE%)"},
40 { STRID_CALC_MIN,
"=MIN(%RANGE%)"},
41 { STRID_CALC_MAX,
"=MAX(%RANGE%)"},
42 { STRID_CALC_SUM,
"=SUM(%RANGE%)"},
43 { STRID_CALC_COUNT,
"=COUNT(%RANGE%)" },
53 pSfxBindings, pChildWindow, pParent, rViewData,
54 "modules/scalc/ui/descriptivestatisticsdialog.ui",
55 "DescriptiveStatisticsDialog")
68 return STR_DESCRIPTIVE_STATISTICS_UNDO_NAME;
77 std::unique_ptr<DataRangeIterator> pIterator;
89 for( ; pIterator->hasNext(); pIterator->next() )
93 if (aColRowLabel.isEmpty())
100 aTemplate.
applyNumber(
u"%NUMBER%", pIterator->index() + 1);
114 for(sal_Int32
i = 0; lclCalcDefinitions[
i].aFormula !=
nullptr;
i++)
116 OUString
aLabel(
ScResId(lclCalcDefinitions[
i].aCalculationNameId));
124 for( ; pIterator->hasNext(); pIterator->next() )
128 for(sal_Int32
i = 0; lclCalcDefinitions[
i].aFormula !=
nullptr;
i++)
131 aTemplate.
applyRange(
u"%RANGE%", pIterator->get(), b3DAddress);
void writeFormula(const OUString &aFormula)
void writeBoldString(const OUString &aString)
void writeString(const OUString &aString)
void push(SCCOL aRelativeCol=0, SCROW aRelativeRow=0, SCTAB aRelativeTab=0)
ScAddress mMaximumAddress
ScAddress mMinimumAddress
static sal_uInt16 GetChildWindowId()
virtual ~ScDescriptiveStatisticsDialog() override
virtual TranslateId GetUndoNameId() override
ScDescriptiveStatisticsDialog(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScViewData &rViewData)
virtual void Close() override
virtual ScRange ApplyOutput(ScDocShell *pDocShell) override
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
bool DoClose(sal_uInt16 nId)
OUString ScResId(TranslateId aId)
formula::FormulaGrammar::AddressConvention eConv