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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Table - Totals Incorrect

Hello Everyone,

I am facing a problem with incorrect totals showing up on the Pivot table .

The expression that I am using is :

=(sum({<YEAR={$(vMaxYear)},Start_Date={"<=$(vMaxDate)"},Month1=,Type=>}TotalCostofActivity))/(sum({<YEAR={$(vMaxYear)},Start_Date={"<=$(vMaxDate)"},Month1=>}EXCHANGE_RATE))

I am using 3 different dimensions as given below:

ProcessName,

Activityname,

Month1.

I would greatly appreciate if anyone could help me fix this issue.

5 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I don't think that anyone can just guess what's wrong. You'll need to explain your problem in more detail. A sample document would be the best.

One potential issue that I can see from your definition is that your Set Analysis condition is heavily dependent on dates, while Month1 is one of your dimensions. Set Analysis cannot be sensitive to the dimension values, and that can create some unexpected issues.

Other than that - describe your problem and possibly post a sample document that illustrates the problem.

cheers,

Oleg Troyansky

QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense

Ask me about Qlik Sense Expert Class!
sunny_talwar

What is your expected output? Sum of all the rows? If Yes, then try this:

Sum(Aggr((sum({<YEAR={$(vMaxYear)},Start_Date={"<=$(vMaxDate)"},Month1=,Type=>}TotalCostofActivity))/(sum({<YEAR={$(vMaxYear)},Start_Date={"<=$(vMaxDate)"},Month1=>}EXCHANGE_RATE)), ProcessName, Activityname, Month1))

maxgro
MVP
MVP

maybe you have to aggr by your dimensions (if the problem is only on total)

=

sum(

aggr(

(sum({<YEAR={$(vMaxYear)},Start_Date={"<=$(vMaxDate)"},Month1=,Type=>}TotalCostofActivity))/(sum({<YEAR={$(vMaxYear)},Start_Date={"<=$(vMaxDate)"},Month1=>}EXCHANGE_RATE))

,

ProcessName,

Activityname,

Month1

)

)

Not applicable
Author

Hi Massimo,

Apprecite your suggestion.!

The expression is now giving the totals Correct.

However, the effect of YTD on the expression is not working alright.

For example, if I choose 'July' as the month, the table now shows data only for July month.

But, the requirement is to show YTD data, from Jan to July.

Not applicable
Author

Hi Sunny,

Your expression worked just fine. The totals are correct now.

However, I am facing issue with displaying data for YTD expression.

For example, if I choose 'July' as the month, the table now shows data only for July month.

But, the requirement is to show YTD data, from Jan to July.