5 Replies Latest reply: Feb 26, 2016 7:55 AM by Sunny Talwar

# How to obtain an earlier result in the present one

Hello all,

I would like to explain one question I have:

Having the following example file,

 VIHLStoreCode Week Year 1-2016 2-2016 3-2016 result desired 3-2016 STORE1 0 OS 0 OS STORE2 0 0 0 0 STORE3 0 1 0 1

When mi results is 0 I want to copy the same result as the earlier week.

Could anyone let me know some clue or solution?

stalwar1

• ###### Re: How to obtain an earlier result in the present one

Is this in a pivot table or straight table? Would you be able to provide a sample qvw?

• ###### Re: How to obtain an earlier result in the present one

Hello Sunny! It is a pivot table

• ###### Re: How to obtain an earlier result in the present one

Try this expression:

=If(ColumnNo() > 1 and Only(Value) = 0, Before(Only(Value)), Only(Value))

• ###### Re: How to obtain an earlier result in the present one

Hello Sunny,

As always, thanks for your support and efectiveness!

I tried your solution, and it worked but with a limit, as you can see in my output, the formula works only for one period, but it doesn't work for all my periods:

Could you help me to extend this results to all the periods??

• ###### Re: How to obtain an earlier result in the present one

Can you try this:

=If(ColumnNo() > 1 and Only(Value) = 0, Before(Column(1)), Only(Value))

Where the 1 in Column(1) is the determined by expression number in your chart object.

In the sample there was only one expression and hence I used Column(1). But if this was 2nd expression, I would have used Column(2).

I hope that this make sense?