Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous quarter Balance in Pivot

Thanks in advance

I have one report which has calculated dimension Q1 2013, Q2 2013, Q3 2013, Q4 2013, Q1 2014

& expression as below.

Previous Quarter Balance  = Sum({<OrderDate = {">=$(=vPrevQtrStartDate) <=$(=vPrevQtrEndDate)"}>} Balance)

Current Quarter Balance   = Sum(Balance)    - This is fine

vPrevQtrStartDate= QuarterStart(Addmonths(OrderDate, - 3))

vPrevQtrEndDate= QuarterEnd(Addmonths(OrderDate, - 3))

I always get 0 for Previous Quarter Balance which is wrong In fact  this should be  Current Quarter Balance from previous column

Your help would be appreciated, Thanks

Labels (1)
23 Replies
Not applicable
Author

Hi Rajendra

I think it would be easier with Above() function

above([ total ] expression [ , offset [,n ]])

Returns the value of expression evaluated with the chart's dimension values as they appear on the row above the current row within a column segment in a table or, in the case of bitmap charts, in the chart's straight table equivalent

Lukasz

MK_QSL
MVP
MVP

Please check there OrderDate and both variable's return should be in same format..

sundarakumar
Specialist II
Specialist II

Please check the values of vPreQtrStartDate and vPreQtrEndDate in a text box...

-sundar

Not applicable
Author

Hi Lukasz

I appreciate your prompt reply.

As I am new in QV, could you elaborate more please

Thanking you

Raj

Not applicable
Author

Good question Sundarakumar

If I use these variable in Text box, I don’t see any value, but if with formula I can see both correct date

Not applicable
Author

It all depends on your data, but if you want to select the value for previous quarter you can use something like this in the chart/table:

Above(Sum(Balance))

sundarakumar
Specialist II
Specialist II

Sorry i dont understand, "if with formula i can see both correct date"

where are u seeing the correct date? Please explain.

-Sundar

Not applicable
Author

I will try

Thanks a lot lot Lukasz

MK_QSL
MVP
MVP

Kindly upload your sample file or apps...