【问题标题】:calculate percentage of two values in the same row in ssrs 2008计算 ssrs 2008 中同一行中两个值的百分比
【发布时间】:2014-10-29 16:57:39
【问题描述】:

我需要你的帮助。我在 ssrs 2008 中有一个矩阵报告。该报告包含一个字段值列和一个值列。我需要计算两个值的百分比。 例如 : 第 1 行:折扣 10 第 2 行:销售额 100 结果:10/100。

【问题讨论】:

  • 你能告诉我你尝试了什么吗?根据提供的描述,听起来您可以只划分 Fields!Discount.Value/Fields!Sales.Value 并对其进行格式化。如果可以,请附上屏幕截图。
  • 嗨,迈克尔,谢谢您的回复。我要做的是计算在同一列中找到的两个值之间的百分比。我需要有这样的东西“如果 column.value = % Discount then sum(value) where column.value = discount / sum(value) where column.value = Turnover”% Discount、Discount 和 Turnover 在同一个列但在不同的行上。我附上了我的矩阵报告的快照。提前谢谢你

标签: reporting-services ssrs-2008


【解决方案1】:

附上输出截图(图片网址:http://i.stack.imgur.com/WroU4.png

    IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE id=OBJECT_ID('tempdb..#Student')) DROP TABLE #Student


    CREATE TABLE #Student
    (
        id INT,
        NAME VARCHAR(100),
        TotalMark INT
    )
    ![enter image description here][1]
    INSERT INTO #Student VALUES ( 1,'Sanjay',635)
    INSERT INTO #Student VALUES ( 2,'Vinay',810)
    INSERT INTO #Student VALUES ( 3,'Ajay',799)
    INSERT INTO #Student VALUES ( 4,'Jay',560)

    SELECT * FROM #Student



Column Value : =str(Fields!TotalMark.Value *100 /1000)+"%"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-12
    相关资源
    最近更新 更多