Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to get Qtr_n ?

Hi All

My below 2 expression work fine :-

 (year(today()) - year([TempDate])) * 12 + month(today()) - month([TempDate]) + 1 as Month_n,
 year(today()) - year([TempDate]) + 1 as Year_n,

May i know how to get Qtr_n ?

year(today()) - dual('Q' & ceil(Month(TempDate)/3) & '-' & right(year(TempDate),2),quarterstart(TempDate)) as Qtr_n1,

it return very large value , which is wrong.

Paul

 

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Maybe something like this:

(Month(QuarterStart(today()))-Month(QuarterStart([TempDate])))/3+(Year(today())-Year([TempDate]))*4 as Quarte_n

View solution in original post

3 Replies
Vegar
MVP
MVP

Maybe something like this:

(Month(QuarterStart(today()))-Month(QuarterStart([TempDate])))/3+(Year(today())-Year([TempDate]))*4 as Quarte_n

Brett_Bleess
Former Employee
Former Employee

Paul, if Vegar's suggest worked, we would appreciate it if you can be sure to return to the thread and use the Accept as Solution button on his post to close the thread, which will give Vegar credit for the assistance and let other Members know that did work for you.

The only other thing I can offer is the following Design Blog post:

https://community.qlik.com/t5/Qlik-Design-Blog/Year-over-Year-Comparisons/ba-p/1462927

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
paulyeo11
Master
Master
Author

Hi All

Thank you for your help it work now.

Paul