0

Fill in Empty cells with previous cell value

I have a columns where there are empty cells and I want to input the empty cell with the value of the previous cell, such as this the last value is $18.54 and I want to impute the same values to the cells below, any inputs ? I'm new to Klipfolio

 

 

1 comment

  • Avatar
    Parker Selman Official comment

    Hi Tejas, 


    Thanks for the post! 

    You can use a custom formula to repeat previous values where blanks are present. This is a little bit tricky given the way Klipfolio handles lists of values, but it's possible with the formula structure below:



    This formula is doing the following:

    1) Intaking a list of your values, added together cumulatively. In the case that there's a 0 in that list, we replace it with a large number that would not naturally occur in your data set
     
    2) Match the entries in that cumulative list with a sorted list of those same values, grouped, so no repeating values exist. 

    3) Return the original value from your data in the position at which that match was found

    Here's that formula in a copy/paste friendly format (note that you'll need to replace the component reference with your own column of data):

    LOOKUP(CUMULATIVE(REPLACE(&'6b4cfbd8-24',0,9999)),
    SORT(GROUP(CUMULATIVE(REPLACE(&'6b4cfbd8-24',0,9999))),"ascnumeric"),
    (SELECT(&'6b4cfbd8-24',&'6b4cfbd8-24'!=BLANK())))

    I hope this helps!

    Parker

Please sign in to leave a comment.