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: 
Not applicable

Month convert to Number

Hi All,

I have a formula which is like

sum

({$<month={num(month(addmonths(today(),-3,1)),'00')}, BUCKET5={"A.*"}>}CURROSSGD)

I got a variable called month. Another variable is BUCKET5. I want to sum up the CURROSSGD.

I would like to get the month value equal to 3 month ago from current month (such as Dec 2014 as today is 17/03/2015.

But anything wrong with the formula above? Why the num is black? Qlikview keeps telling me I got errors.

Anyone can help me out on this?

Thanks a lot.

5 Replies
Not applicable
Author

Try now

=sum({$<month={"$(=num(month(addmonths(today(),-3,1)),'#,##0'))"}, BUCKET5={"A.*"}>}CURROSSGD)




Not applicable
Author

Hi

Try this

=sum({$<month={"$(=num(month(addmonths(today(),-3))))"}, BUCKET5={"A.*"}>}CURROSSGD)

mukesh24
Partner - Creator III
Partner - Creator III

Hi

create variable as

vMonthNum = num(month(addmonths(today(),-3)))

Use above variable in expression

({<month = {"$(vMonthNum)"},BUCKET5 = {"A*"}>} CURROSSGD)

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

Month(AddMonths(Today(), -3))

Regards,

Jagan.

vvvvvvizard
Partner - Specialist
Partner - Specialist

You cant use the Months variable if it contains Jan , Feb , Mar , April ect as Dec -3 is not march.

You should rather use the another variable which contains Month and year together  Dec-14 , Jan15 , Feb-15.

Now you can say Month(AddMonths(Period, -3) )