Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

rajaqliks
New Contributor III

Pivot table totals showing wrong

Hi Folks,

I have created one pivot table, values are showing correct, but totals are not showing correct values , for reference purpose i am adding QVW .

Thanks in advance

2 Solutions

Accepted Solutions
MVP
MVP

Re: Pivot table totals showing wrong

You can try putting an aggregation function around your expression in pivot expression like:

Sum( Aggr ( If(.....) , Contact_Type, WEEKEND))

Highlighted
gn_marvs1989
New Contributor III

Re: Pivot table totals showing wrong

Try this; You need to use the Aggr()

sum(aggr( if(GetFieldSelections(MDESC)='TargetOnly',count({=' & Date(Max(WEEKEND) - 77, 'MM/DD/YYYY') & '<=' & Date(Max(WEEKEND), 'MM/DD/YYYY'))"},RightfulOwner={'Y'},TargetFlag={'1'}>}DISTINCT Key), if(GetFieldSelections(MDESC)='Total Territory',count({=' & Date(Max(WEEKEND) - 77, 'MM/DD/YYYY') & '<=' & Date(Max(WEEKEND), 'MM/DD/YYYY'))"},RightfulOwner={'Y'}>}DISTINCT Key), if(GetFieldSelections(MDESC)='Full Universe',count({=' & Date(Max(WEEKEND) - 77, 'MM/DD/YYYY') & '<=' & Date(Max(WEEKEND), 'MM/DD/YYYY'))"}>}DISTINCT Key)))) ,WEEKEND,Contact_Type))

10 Replies
gn_marvs1989
New Contributor III

Re: Pivot table totals showing wrong

Would this be the solution you need? see attachment

rajaqliks
New Contributor III

Re: Pivot table totals showing wrong

same error, i didn't get the solution

in qvw we have two chart one is bar and second one is pivot table bar graph is showing correct values but the pivot table is not show the correct values in totals please check and help me

rajaqliks
New Contributor III

Re: Pivot table totals showing wrong

compare the values with bar graph chart

MVP
MVP

Re: Pivot table totals showing wrong

You can try putting an aggregation function around your expression in pivot expression like:

Sum( Aggr ( If(.....) , Contact_Type, WEEKEND))

MVP
MVP

Re: Pivot table totals showing wrong

You can try putting an aggregation function around your expression in pivot expression like:

Sum( Aggr ( If(.....) , Contact_Type, WEEKEND))

rajaqliks
New Contributor III

Re: Pivot table totals showing wrong

Thank you very much Tresesco its working great

Highlighted
gn_marvs1989
New Contributor III

Re: Pivot table totals showing wrong

Try this; You need to use the Aggr()

sum(aggr( if(GetFieldSelections(MDESC)='TargetOnly',count({=' & Date(Max(WEEKEND) - 77, 'MM/DD/YYYY') & '<=' & Date(Max(WEEKEND), 'MM/DD/YYYY'))"},RightfulOwner={'Y'},TargetFlag={'1'}>}DISTINCT Key), if(GetFieldSelections(MDESC)='Total Territory',count({=' & Date(Max(WEEKEND) - 77, 'MM/DD/YYYY') & '<=' & Date(Max(WEEKEND), 'MM/DD/YYYY'))"},RightfulOwner={'Y'}>}DISTINCT Key), if(GetFieldSelections(MDESC)='Full Universe',count({=' & Date(Max(WEEKEND) - 77, 'MM/DD/YYYY') & '<=' & Date(Max(WEEKEND), 'MM/DD/YYYY'))"}>}DISTINCT Key)))) ,WEEKEND,Contact_Type))

rajaqliks
New Contributor III

Re: Pivot table totals showing wrong

Hi totals are working fine but Weekly avg and totals are not working could you please help me on that,

i am adding qvw for reference.

 

 

rajaqliks
New Contributor III

Re: Pivot table totals showing wrong

Here is the qvw