Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Sept. 16, Qlik Product Portfolio Strategy and Roadmap for Data Integration 11 AM ET REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
phuelish
Contributor III
Contributor III

Calculated Dimension to show only full quarters

Hello,

I'm creating some trending charts, and want to ensure the current quarter is not displayed unless it is the third month of the quarter.  I had been using the system field ReloadTime() in a calculated dimension to do this:

if([Quarter Name]<QuarterName(ReloadTime()),[Quarter Name])

I'm trying to move away from ReloadTime(), as while the application is generally loaded during the month following the latest data month, it can sometimes be delayed.  As an example, in circumstances where February data isn't loaded until April, the existing calculated dimension would show the [Quarter Name] with only two months of data.

I've tried using AddMonths(Max([Month Name]),1) in place of ReloadTime().

When I test the expression in a textbox, it returns the value I'm looking for...

QuarterName(AddMonths(Max([Month Name]),1)) returns Jan-Mar 2016

When I put it in the dimension, however...

if([Quarter Name]<QuarterName(AddMonths(Max([Month Name]),1)),[Quarter Name])

it gives me an "error in calculated expression".

I've doublechecked that I'm using the same expression that returns the valid text value...any idea what I'm doing wrong or is there a better way?

1 Solution

Accepted Solutions
sunny_talwar

Try this:

If([Quarter Name]<QuarterName(AddMonths(Max(TOTAL [Month Name]),1)),[Quarter Name])

View solution in original post

4 Replies
sunny_talwar

Try this:

If([Quarter Name]<QuarterName(AddMonths(Max(TOTAL [Month Name]),1)),[Quarter Name])

View solution in original post

phuelish
Contributor III
Contributor III
Author

Worked like a charm!  Thanks!

sunny_talwar

Awesome

arunqlik2view
Creator
Creator

Hi Sunny, 

I need the same thing , to show only full Quarters but I'm not sure how to use the below syntax of yours as I'm not sure which one is the dimension and which one the keyword.

 

If([Quarter Name]<QuarterName(AddMonths(Max(TOTAL [Month Name]),1)),[Quarter Name])

 

I tried to use like this :

If([Quarter]<QuarterName(AddMonths(Max(TOTAL [Month]),1)),[Quarter])

 

Where, 

Quarter is the FY Quarters, 

Month is the months from Jan to Dec.

 

Kindly advise on this. 

Thanks in Advance.