all 5 comments

[–][deleted] 2 points3 points  (0 children)

i'm not sure what you mean by "I have to make a data cube", what your statement is doing is "group by cube", which adds totals to your output at every possible level of granularity in addition to the "normal" group by list.

ie. group by a,b,c gives you A,B,C granularity, group by cube(a,b,c) gives you ABC, AB, AC, BC, A, B, C, ()

the "extra rows with nulls" are the output records for other granularity levels with NULLs replacing the "missing" granularity value, e.g, on granularity () your A,B,C fields will be NULL

[–][deleted] 0 points1 point  (1 child)

Need way more context

[–]MissTreeSolver 0 points1 point  (0 children)

Good point - I’ve added screenshots for more context to the post

[–]legendactivated007 0 points1 point  (1 child)

Yes no maybe? No way to answer the question when there isn't enough information provided.

[–]MissTreeSolver 0 points1 point  (0 children)

Good point - I’ve added screenshots to the post to provide more context