Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

do we have RelativeDate function in QV?

Hi All,

Do we have relativeDate function in QV,if we have how we can use it and what is the important of this function.

below variable was in SAP BO format so i am trying convert it into QV.

If [MTO Status]="MTS" Then RelativeDate([Created on (0CREATEDON)];Round((([Total Replenishment Lead Time])/5)*7;0)ElseIf  [MTO Status]="MTO" Then RelativeDate([Created on (0CREATEDON)];Round(((([Total Replenishment Lead Time])/5)*7)+7;0))

Thanks

4 Replies
Not applicable
Author

do we have relativeDate function in qlikview,any suggestions pls

giakoum
Partner - Master II
Partner - Master II

what don't you explain what this function does? Then we maybe can help you...

Not applicable
Author

here is the sample example for relativeFunction ,

=If(DayName(CurrentDate())=”Monday”;RelativeDate(CurrentDate();-3);If(DayName(CurrentDate())=”Sunday”;RelativeDate(CurrentDate();-2);RelativeDate(CurrentDate();-1)))

Lets break down this formula.

An IF expression has three components:

If(boolean_expr;value if true;value if false)

The boolean_expr part is the statement that we test.

In our case, we want to check if the CurrentDate() is a Monday.

If it is true that it is a Monday, we want to use the RelativeDate function to subtract 3 days from the CurrentDate().

If it is false, i.e. the current date is not a Monday, we need to perform a further check. This requires a second IF statement to perform this second check.

The second check asks if the CurrentDate() is a Sunday.

If it is true that it is a Sunday, we want to use the RelativeDate function to subtract 2 days from the CurrentDate().

If it is false, i.e. the current date is not a Sunday, and we know its not a Monday as we checked for that previously, then we know that the day is a Tuesday, Wednesday, Thursday, Friday or Saturday and hence we can safely use RelativeDate with a value of -1 to give us the previous working day.

PrashantSangle

Hi,

You can use

if you want add Days : Date(num(day+3))

if you want to add Months : AddMonths(Datefield,2)

If you want to add Years : AddYears(Datefield,2)

For details go to Help Menu.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂