我在大查询中使用了枢轴,但这是一个特定的用例和我需要在Looker中显示的数据。我正在尝试Looker中的类似选项,但想知道我是否可以在大查询中显示此选项。
这就是我的数据(示例)大查询
表是:
输出应如下:
它是枢轴的,但是我需要分配如图所示(对于特定范围)的列名,对于6范围以及更多内容,我需要将枢轴列数据添加到一个。
我在 big_query
中看不到枢轴索引或类似索引。是否有办法在枢轴索引6左右之后总结列数据?有什么建议如何实现这一目标?
I have used pivot in big query, but here is a specific use case and the data that I need to show in looker. I am trying the similar option in looker but wanted to know if I can just show this in big query.
This is how my data (Sample) in BIG QUERY
table is:

The output should be as below:

If you look at it, it's pivoting but I need to assign the column names as shown (for the specific range) and for the range 6 and more, I need to add the pivot columns data into one.
I don't see pivot index or something like this in BIG_QUERY
. Was thinking if there is a way to sum up the column data after pivot index 6 or so? Any suggestions how to achieve this?
发布评论
评论(1)
希望下面的方法会有所帮助,
输出:
Hope below approach would be helpful,
output: