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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
danosoft
Specialist
Specialist

Problema Addmonth function

i need to subtract 1 month to my date,

in my variable date i have always the last day of the month

soi see if in my variable date have for example 28/02/2018 with the expression:

AddMonths(Date($(vFineMonthContrAltAnnoTempo), 'DD/MM/YYYY'),-1)

it show me 28/01/2018.. but is wrong i need to show the last day of the month so 31/01/2018 when i subtract -1

so if i have in the variable 30/06/2018, when i do the expression AddMonths(Date($(vFineMonthContrAltAnnoTempo), 'DD/MM/YYYY'),-1)

i want to show 31/05/2018 and not 30/05/2018

how can i do that?

thanks

1 Solution

Accepted Solutions
neelamsaroha157
Specialist II
Specialist II

Try this:

MonthEnd(AddMonths(vFineMonthContrAltAnnoTempo, -1))

View solution in original post

1 Reply
neelamsaroha157
Specialist II
Specialist II

Try this:

MonthEnd(AddMonths(vFineMonthContrAltAnnoTempo, -1))