Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

debabrata_sahoo
New Contributor III

how to set variable on previous year

How to set variable on previous year date.

Example

when I select a date on date field like '23-Jul-2018' then same time variable value is '23-Jul-2017'.

Please help me out.

1 Solution

Accepted Solutions
MVP
MVP

Re: how to set variable on previous year

AddYears(today(), -1)

AddYears(Date, -1)

4 Replies
Highlighted
arvind1494
Valued Contributor

Re: how to set variable on previous year

Hi

23-Jul-2018

24-Jul-2018

25-Jul-2018

26-Jul-2018

27-Jul-2018

28-Jul-2018

29-Jul-2018

Use this in the defination of your variable

MVP
MVP

Re: how to set variable on previous year

AddYears(today(), -1)

AddYears(Date, -1)

dapostolopoylos
Contributor III

Re: how to set variable on previous year

Check the attached app:

Father/Husband/BI Developer
fawazeez
Contributor

Re: how to set variable on previous year

AddYears(Max(datefildl), -1)