Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
aritting
Creator
Creator

Calculated Date Dimensions in a Pivot Table?

I would like to create a pivot table that has the current Year and the current and previous Quarter as calculated dimensions.

I've found that I can get current year by year(today()) expression butI'm not sure how to get the current and previous quarter.

1 Solution

Accepted Solutions
sunny_talwar

I thought you needed 2015 Q2 and 2014 Q2. For what you need, try this:

Two of your dimensions will be

If(Match(Year, Year(Today(), Year) for Year Dimension

If((Date >= AddMonths(QuarterStart(Today()), -3) and Date <=QuarterEnd(Today())), Quarter) for Quarter Dimesnion

View solution in original post

6 Replies
sunny_talwar

May be like this:

If(Match(Year, Year(Today(), Year(Today()-1), Year) for Year Dimension

If((Date >= QuarterStart(Today()) and Date <=QuarterEnd(Today())) or (Date >= QuarterStart(AddYears(Today(), -1)) and Date <=QuarterEnd(AddYears(Today(), -1))), Quarter) for Quarter Dimesnion

Check the option on the Dimensions tab - > Suppress When Value Is Null for both the dimensions.

HTH

Best,

Sunny

aritting
Creator
Creator
Author

I'm not following what is going on there.

aritting
Creator
Creator
Author

I want to see a pivot table chart where the current year is the calculated dimension and the current and previous quarter

2015          Q1

                 Q2

sunny_talwar

I thought you needed 2015 Q2 and 2014 Q2. For what you need, try this:

Two of your dimensions will be

If(Match(Year, Year(Today(), Year) for Year Dimension

If((Date >= AddMonths(QuarterStart(Today()), -3) and Date <=QuarterEnd(Today())), Quarter) for Quarter Dimesnion

aritting
Creator
Creator
Author

=if(Match(Year, Year(Today())),Year)

MarcoWedel

Hi,

another solution could be:

QlikCommunity_Thread_168828_Pic1.JPG

QlikCommunity_Thread_168828_Pic2.JPG

QlikCommunity_Thread_168828_Pic3.JPG

hope this helps

regards

Marco