ruby ABC班级/排名整体

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby ABC班级/排名整体相关的知识,希望对你有一定的参考价值。

/* we alreayd have a profit column */

TeamIncrementalProfit
=CALCULATE(
	SUM( Sales[Profit] ),
	ALLEXCEPT( Sales, Sales[Team] ),
	Sales[Profit] >= EARLIER( Sales[Profit] )
	)
	
	/* team total profit */
	
	=CALCULATE(
	SUM( Sales[Profit] ),
	ALLEXCEPT( Sales, Sales[Team] ) )
	
	/* incremental pct */
	
	=DIVIDE(Sales[TeamIncrementalProfit],Sales[TeamTotalProfit])
	
	
	/* class calculation */
	
	=SWITCH( TRUE(),
Sales[TeamIncrementalPct] <= 0.8, "A",
Sales[TeamIncrementalPct]<=0.9, "B",
"C" )
	
/* we have a column with normal profit figures, we need to calculate a column with incremental profit */
IncrementalProfit=
VAR CurrentProfit = Sales[Profit]
RETURN
	SUMX (
	FILTER( Sales,
		Sales[Profit] >= CurrentProfit),
	Sales[Profit]
)

/* next formula will get total profit overall for the company */

TotalProfit =SUM(Sales[Profit])

/* to ge the incremental pct below formula */

=DIVIDE( [IncrementalProfit], [TotalProfit] )

/* to get the class */

Class=
SWITCH( TRUE(),
  Sales[IncrementalPct] <= 0.8, "A",
  Sales[IncrementalPct]<=0.9, "B",
  "C"
  )

以上是关于ruby ABC班级/排名整体的主要内容,如果未能解决你的问题,请参考以下文章

福大软工 W班级总成绩排名3

查询每个班级排名第三的学生

查询每个班级排名第三的学生

查询每个班级排名第三的学生

查询每个班级排名第三的学生

怎么循序渐进写出分组排名