Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
rishikeshtiwari
Creator
Creator

Derive a Value Based on two dates and a Value

We have an requirement. I have a table having Some fields.Two fields are of Date fields Date1 & Date2. In respect of Date1 field there is a Value1 field. We need to derive the Value2 with respect to date2.

Value2 is depend on 3 fields Customer, Date1 and Value1.

Example in Excel Sheet::

For C1 ,Date1 is 01/01/2016 and Value is 100.Therefore for Date2 we need to derive the value2.

Logic is that if for Same Customer Date1 <=Date2 then Value1 will be the value2.

For Column 1 Value of Value2 will be 100 because Date1=Date2.

Other case Column2 ::Date1 > Date2 ,In this case we will see the upper value of Date1 if this Date <= Date2 then Value of Value1 for that will  be the Value of Value2.

For Column2 Value2 will be 100.

Same for column3 Value2 will be 100 because Date1> date2.

So we are always assuming the value of value2 ,according to date2 where Date1<=Date2.

If not then we assuming previous value. If the previous Date is also large then we will check upper of the previous value.

That is our overall logic.

Thanks

Rishi

1 Reply
sunny_talwar

I see you marked this as 'Assumed Answer', have you resolved your issue?