Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Getting years as a number, not date

I have the following expression which works fine and converts to '2015'

=Date(AddMonths(Today()-12),'YYYY')

but when I modified it to:

=Date(AddMonths(Today()-12),'YYYY') x 12

I want it to take 2015 x 12 = 507936 instead of 24180.

How do I get it to look at the year as a number for this expression instead of a date?

Zag

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

You want it to return 12*2015 = 24180?

Then just calculate a year value, not a formatted date:

=Year(AddMonths( Today(),-12)) *12

If you want it to return 507936, that's what your expression already does:

=Date(AddMonths( Today(),-12)) *12

View solution in original post

4 Replies
Highlighted

Maybe something like

    =num(AddMonths(Today(),-12)) * 12

Highlighted
MVP
MVP

You want it to return 12*2015 = 24180?

Then just calculate a year value, not a formatted date:

=Year(AddMonths( Today(),-12)) *12

If you want it to return 507936, that's what your expression already does:

=Date(AddMonths( Today(),-12)) *12

View solution in original post

Highlighted

(Year(Today())-1)*12

Highlighted
Creator III
Creator III

for 24180:

calculate a year value, not a formatted date:

=Year(AddMonths( Today(),-12)) *12

for 507936:

=Date(AddMonths( Today(),-12)) *12

Regards

Hemanth