4 Replies Latest reply on Apr 22, 2017 6:03 PM by Zhouyi Zhang

    Previous Non Null Values

    Sunita Reddy

      I am new to Tableau and would greatly appreciate if someone could help me with this. I have a report that shows foreign exchange conversion rates. There are some days that some currencies are blank. On the days that these conversion rates are blank, I want the previous non null rates to be picked up. I used the previous value formula as below:

      if isnull(LOOKUP(sum( [Ukurs] ),0 )) then PREVIOUS_VALUE (sum( [Ukurs] )) else sum( [Ukurs] ) end

       

      It works fine for all other days but on Mondays if this rate is blank, then it looks for the previous day which is Sunday (the rates are not populated for Saturdays and Sundays) and since it finds it blank, it returns blank. I would want to be able to pick the first previous non null rate. Attached is the picture of the report.

       

      Thanks in advance for your time.