6 Replies Latest reply on Dec 1, 2016 12:52 AM by Tulu Sahoo

# Calculations

I want to search Null values in every rows, once got one null values then i want to replace null values from that value onwards

• ###### 1. Re: Calculations

Hi Tulu,

You could create a calculation like IF [MyField] is null then 1 else [MyField] END.

If this doesn't solve your problem please upload a Tableau Packaged Workbook including some sample data and provide more detail around what you're trying to calculate.

• ###### 2. Re: Calculations

Sorry Friend, It is not working.

• ###### 3. Re: Calculations

Hi Tom,

That is my data, PFB my expected result:

For Example :For region Central 2016 value is Null so I want whole the row of central region should be replace to Null.

2nd Example: West region 2015 value is Null so that value onwards want to replace Null.

• ###### 4. Re: Calculations

Create a calculated field to determine the maximum blank period. MaxBlank= {FIXED Region : MAX(IF ZN([Sales]) = 0 then Year END )}

This field uses a Level of Detail calculation.

Then setup a field to determine the sales based on the MaxBlank item. IfSales=SUM(IF Year>=[MaxBlank] then [Sales] end)

Use this field in your report.

• ###### 5. Re: Calculations

Hi Tom,

Thanks for your reply, By using these calculations all the values are coming blank.

Kindly provide some other solution.

Tom----> We have to create one calculated field which will scan every row for the Null, once it will get , from that position onwards till last will be replace as null but behind that position values should keep as previous value.

Thanks.

• ###### 6. Re: Calculations

Hi Friends,

I have developed one workaround solution for my problem. You can use below calculations to achieved this solution.

IF INDEX()>WINDOW_MIN(if isnull([Measure]) then INDEX()) then Null else [Measure] end