mysql - 由另一列分组的所有不同列值的总和?

标签 mysql sql data-visualization qlikview

我有一个这样的表:

project_name      janExp      febExp      marchExp      aprilExp
project A           1000      1100          1200          1300
project B           2000      2100          2200          2300
project C           3000      3100          3200          3300
project A           500       600            700           800
project B           100       200            300           400

我想要这样的输出:

project_name          janExp      febExp      marchExp        aprilExp
Project A              1500        1700           1900           2100
Project B              2100        2300           2500           2700
project C              3000        3100           3200           3300

我是 Qlikview 的新手,有人可以告诉我需要为其编写什么表达式吗?

最佳答案

只需创建一个直表格enter image description here !

您的脚本应如下所示:

enter image description here

你可以看到标题中的表达方式。使用字段“project_name”作为维度:

enter image description here

关于mysql - 由另一列分组的所有不同列值的总和?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37781387/

相关文章:

mysql - 我们可以在一个唯一查询中使用两个聚合 count() 函数吗?

mysql - 加快SQL查询速度,已经有效

python - 在 Paraview 中合并来自多个文件的 PointData

javascript - 在 d3.js 中制作弧线

python - 两个具有相同轴或在同一图形上的 matplotlib/pyplot 直方图

php - Zyxel NSA310 - PHP 显示源而不是执行

Mysql 在 select 或 where 子句中使用搜索/过滤语句会更快吗?

php - 尽管通过表单发布了数据,但空行仍被插入到数据库中

mysql - 如何使用日期时间选择 SQL 中大于特定时间的条目?

mysql - 具有唯一约束的原子多行更新