0:00Tableau Prep now does running sums natively
0:04. It's new in 23.3 to find out
0:05how, as ever, let's get stuck in. Okay so
0:08to do this I've just opened a standard
0:10flow in Tableau Prep. This is one of the
0:12default flows that comes in. It's called
0:13Superstore. If you look on the bottom left
0:16when you open Tableau Prep this is
0:17the flow you'll see. Now if I just zoom out
0:20here you'll see this is a very
0:22simple flow. It's already been built for us
0:24. All I'm going to do is actually add a
0:26step. In fact I've already added it so I'm
0:28going to delete it here because I
0:29forgot to do that before I hit record. Let
0:32's go over to this rolling up of
0:34sales and if we just look at this step you
0:35can see there's some aggregation
0:37happening. And what I want to do is show
0:39you this function. To do that I'm just
0:41going to hit this plus icon and select the
0:43clean step. The reason I need to do
0:45this is because the calculation we're going
0:47to add is actually created from
0:48selecting a column and selecting a
0:50calculation. So if I take my sales column
0:53as an example and I go ahead and create a
0:55calculated field you see I get this
0:57drop down and in there you can see the
0:58running calculation is the new feature.
1:00Let's go ahead and select that and it opens
1:02up this beautiful interface. This
1:04is one of the best parts of Tableau Prep. I
1:07think it's my favorite bit out of the
1:09whole entire Tableau platform this year.
1:12This has just been such a nice addition
1:13to Tableau Prep because of the way it works
1:16. It breaks down how to do multi row
1:18counts in a way that I think enhances what
1:20we've seen in Tableau Desktop for
1:23table calculations. How does it work? Well
1:25it's super simple. First you need to
1:27select what you're going to group your
1:29table by and if you think about it when
1:31we're doing running sums there is
1:33essentially a grouping and the default
1:35option is just to do a running sum on the
1:37whole entire table so by default
1:39that's what's selected. You can change this
1:42and you can choose some of the
1:43other items. You can choose the year of
1:44sales or quantity. But let's go ahead
1:47and choose the ordering first because I
1:49want to show you a behavior that you
1:52should be aware of when you do this and you
1:53might wonder why can't I see
1:54something. This is probably going to be why
1:57. If I select year of sales to order
1:59the running sum calculation that makes
2:01sense because time is generally a good
2:03way of ordering our information. But as
2:05soon as we select year of sale there you
2:08can no longer group by it. So this is going
2:10to be just something to watch out
2:11for. If you're ordering by something it's
2:14removed from the group by section and
2:16these are all the fields in this particular
2:18step. So you do have the
2:20option to choose how you're grouping and
2:21how you're going to order your data.
2:23That's an important element because of
2:25course you're going to need to run your
2:27running sum in a specific direction and
2:29that's decided by how you order the data.
2:32So if we order by year you can see it
2:35pretty much grabs all our years and it
2:37puts them together and then it shows us the
2:40sum that it's going to do. So the
2:42nice thing about this interface is that it
2:44actually explains exactly what's
2:45going on. So if we do a running sum on the
2:47full table what we should see is
2:49that the second row is the previous two
2:51rows combined. So if I click on that
2:53second row you can see Tableau does this
2:55really nice animation that shows a
2:57dotted line around the sums that it's doing
2:59and then it shows you the result
3:01in the current box that you're in. So as
3:03you start to go down you can see this
3:04animation update. It's just a really nice
3:07touch. I don't know why this makes me
3:09so happy. Whoever's built this, absolute
3:11chef's kiss. Love it. Now when you start
3:15to work with this a bit more you might
3:17notice that there's a few things to be
3:19aware of. So let's change this up a little
3:22bit. Instead of grouping by year
3:24of sales, let's actually instead of
3:27grouping by full table let's go ahead
3:28and actually group by sales region and you
3:31'll see that it changes a bit because
3:33now we're slightly changing the context. So
3:35if I go back to the top of my data
3:37you can see here, USCA, LATAM and then you
3:40've got the ordering by year of sales.
3:43So it actually rearranges the data to kind
3:45of first do the grouping then order
3:48by the years and so when you do the running
3:50sum, the running sum starts on
3:52the first row of course but then it ends
3:55here. Can you see it ends there on the
3:57that sort of fourth row then on the next
3:59row it starts again and then as we go
4:01down it goes again it's using our LATAM to
4:04do the grouping and then it starts
4:06again and so this is essentially like doing
4:08table calcs using panes and
4:10dimensions inside of Tableau but it's just
4:12much much easier to see what's
4:14going on here and the really nice thing
4:16here you may not didn't notice this
4:18that you actually get Tableau calling out
4:20you see this sort of blue highlighting
4:22here that's happening on the right hand
4:24side I can't really click on the right
4:25on the right part of it you can just see
4:27these blue highlights they're
4:29essentially showing you where you're
4:31running sums end and that's a super
4:33useful thing to notice because by looking
4:35at that you can see okay my
4:37running sum ends on these particular places
4:39and you can kind of go to them
4:40and look at them and so if I go back to my
4:43full table you'll see that that
4:44right-hand side changes and there isn't
4:46really one for the very end because it's
4:48just the entire table but if we change it
4:50to let's say we don't really have
4:52something else we can group by that makes
4:54sort of logical sense but yeah if
4:56we change it back to sales region or
4:58actually if we put we can't even really
5:00order by profit or discount I mean if we
5:03wanted to order the the the the rows by
5:05largest to smallest based on these measures
5:07you could do that but anyway
5:08you get the idea this interface is there to
5:11be sort of played with now you're
5:13probably wondering well you know what are
5:15the things I can do with this well of
5:17course you've got the running sum that
5:18makes total sense running average is a
5:21little bit more nuanced because of course a
5:23running average is going to be
5:25based on your grouping so again if we
5:27select average we select these you'll
5:29see that all it's doing is adding up the
5:31previous rows then dividing by three
5:33because that's what an average does so
5:34those are the two calculations you can
5:36do running some running average and then of
5:38course the computation can be done on
5:40any measure so discounts profit or sales by
5:43the way when you're done you can go
5:45ahead and hit done and you're done but the
5:47thing I always forget to do is just
5:49rename these I don't know I don't know why
5:51and I think it's actually probably
5:52because honestly speaking when it's created
5:55and it's not sort of in I don't
5:58know if it's me missing something or what's
6:00going on but I can just I just
6:02always create this I hit done and I've only
6:05really ever paid attention to this
6:08now and then I rename it I've always
6:10wondered why can't I why can't I just
6:12you know rename these right there so it's a
6:16weird one oh no you can I just
6:19had a little bug or something when whenever
6:21I clicked on that and you saw
6:22me actually smash the the mouse then and it
6:25actually works maybe that's a bug and
6:27that's happened to me all the time and
6:28maybe it's worked this time but hey
6:30that's that's the wonder of production
6:32sometimes you do these things and then
6:34they work for you when you're doing the
6:36real take but anyway here we go that's
6:38pretty much the features not much more to
6:40share there and thanks for watching
6:41this video I've been making videos about 23
6:44.3 I'm making videos about chat GPT as
6:46well I'm kind of hopping in between them I
6:48've recorded three videos actually
6:50about tableau embedding I'm kind of teeing
6:52them up so they can come out back
6:54to back so we're gonna try and do a little
6:56bit of a sprint all the way till
6:57Christmas get all the videos that I've sort
6:59of been on the backlog out so be
7:01sure to keep watching I'm also sort of
7:03fighting in between colds and winter and
7:06everything you'll probably hear my voice is
7:08going but nonetheless thanks for
7:10watching and I'll see you the next one
7:14you
7:22[BLANK_AUDIO]