Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

Pivot totals are not matching

Hi Community,

Facing issue with totals on Povit table.

Could you please help me...

my Expression is:

IF(PeriodType='YTD' and Status='Opening',
Sum({<Month = {"$(=Month(YearStart(Today())))"}>} Value),

IF(PeriodType='YTD',
Sum({<Period = {">=$(=Date(YearStart(Max(Period)),'DD/MMM/YY'))<=$(=Date(MonthEnd(Today()),'DD/MMM/YY'))"}, Month=>} Value)))

paulwalker_1-1630347788309.png

Totals are not matching....

Thanks in Advance!

 

1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

What if you try this...

IF(PeriodType='YTD',
    Sum({<Status = {'Opening'}, Month = {"$(=Month(YearStart(Today())))"}>} Value)

    +

    Sum({<Status -= {'Opening'}, Period = {">=$(=Date(YearStart(Max(Period)),'DD/MMM/YY'))<=$(=Date(MonthEnd(Today()),'DD/MMM/YY'))"}, Month=>} Value)

)

View solution in original post

3 Replies
stevejoyce
Specialist II
Specialist II

What if you try this...

IF(PeriodType='YTD',
    Sum({<Status = {'Opening'}, Month = {"$(=Month(YearStart(Today())))"}>} Value)

    +

    Sum({<Status -= {'Opening'}, Period = {">=$(=Date(YearStart(Max(Period)),'DD/MMM/YY'))<=$(=Date(MonthEnd(Today()),'DD/MMM/YY'))"}, Month=>} Value)

)

Or
MVP
MVP

If I read this correctly, for the Total row, only the second part of the If() statement will be evaluated, as the status isn't 'Opening' (there's multiple statuses so the condition evaluates to false). You'd need to either rewrite the formula so that the if() statements are inside the sum() statements (and thus evaluated for each line individually), or use Dimensionality() to add a separate formula for the Total.

 

stevejoyce
Specialist II
Specialist II

I agree with @Or .  That's why i merged into 1 single expression adding them together, but status in set analysis to only evaluate as desired.  But that should do it.