Forum

PQ "Fill Down" in g...
 
Notifications
Clear all

PQ "Fill Down" in groups

3 Posts
2 Users
0 Reactions
172 Views
(@blankab)
Posts: 63
Estimable Member
Topic starter
 

Dear All,

I need to figure out how to use "Fill Down" in PQ, but based on groups.

In other words, in the attached example I need to fill down the "Capital" for each country, which is a simple task. But if a value in Capital column is missing for a given country, I need this to remain null. 

I imagine that I would need to group by Country and then Fill Down Capital column within the groups. Is that even possible?

(This is not my real data, just came up with a simple example to illustrate my problem.)

Thank you,

Blanka

 
Posted : 09/08/2024 6:25 pm
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

Indeed! Group by Country, All Rows. Then add a custom column where you type the M-code for a "fill down" referring to the custom column, now containing tables by country. See attached.

Note that I needed to use Table.Buffer in the sorting step as PQ somehow didn't 'keep' the sort order when grouping by country.

 
Posted : 10/08/2024 2:11 am
(@blankab)
Posts: 63
Estimable Member
Topic starter
 

Works like a charm. 

Thank you so much for your help, Riny!

 
Posted : 10/08/2024 12:14 pm
Share: