Calculate sum of column and repeat value across all rows.

Hello,
I am trying to go from this:

COL1    COL2
ABC     1
DEF     2
GHI     3

to adding a sum of Col2 to Col3, but so it displays across all rows.

COL1    COL2   COL3
ABC     1      6
DEF     2      6
GHI     3      6

Now, in SQL I can do that no problem:

SELECT *
  ,(SELECT SUM(Col2) FROM Your_Table) Col3 
FROM Your_Table

However, I am not sure how I can accomplish the same without converting my Explore into SQL, which kind of defeats the purpose of having an Explore.
Is it possible to do something like this in a derived table block, with referencing ML objects? Even if I have to convert the explore into a bunch of joined views, that would be better than straight SQL.

0 6 10.6K
6 REPLIES 6
Top Labels in this Space
Top Solution Authors