Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
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
Partner
Partner

Maybe something like this:

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

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

3 Replies
Vegar
Partner
Partner

Maybe something like this:

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

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

Brett_Bleess
Support (Former)
Support (Former)

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