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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

getting wrong calc in the Totals for the Pivot table?

HI All,

In this report, I am having sales, target, call avg, % Ach , closing ..

% Ach will be always sales divided by target which i am having already calculated value, but in total also it should come total sales divide by the target,

but was showing sum of % Ach which is wrong it should show as 0.85..

Also for the call avg, but in the total it was showing sum, i need to get the avg of the calls is 59..

And for the closing it should come as the Last Month closing means feb Month in the Total as 75.

Month Selection will be the From Month as Jan & To Month as Feb..

For Sales & Target it getting total its correct..

How can i achieve Call avg & %ach in the Total...

Kindly help me on this..

Regards,

Helen

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attached qvw


talk is cheap, supply exceeds demand

View solution in original post

12 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you want a sum then use the sum function, but if you want an average then use the avg function. See attached example.


talk is cheap, supply exceeds demand
Anil_Babu_Samineni

You expression is bit long

How about this?

Sum({<Month >} Sales)

or

From Below what are you expecting

OrderIDTypeNameMonthSales
10248SalesJan63.55
10248SalesJan140.4
10248TargetJan343.44
10248%AchJan0.59
10248calls avgJan58
10248closingJan45
10249SalesFeb205.2
10249TargetFeb250
10250SalesFeb95.9
10250%AchFeb1.2
10250calls avgFeb60
10250closingFeb

75

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Thanks you, Gysbert.. it suits my requirement.

Here I am having one flag condition,

Example:  In Flag having Prim & Sec ..

If select Prim need to show all the expressions as above.

If I select Sec then i dont want to see Closing & Calls avg 7 remainig i wanted to see..

Regards,

Helen

Anil_Babu_Samineni

Like this

For Ref, Please find attachment

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Example:  In Flag having Prim & Sec ..

Which example? I don't see any Flag, Prim & Sec fields or values in the document you posted.


talk is cheap, supply exceeds demand
tresesco
MVP
MVP

Use SecondaryDimensionality() like in attached sample. I have done it for one measure - %Ach, replicate similarly for rest.

If (SecondaryDimensionality()=0, If( TypeName='%Ach', Sum(total{<TypeName={'Sales'}>}Sales)/Sum(total {<TypeName={'Target'}>}Sales)),

sum({<Monthno={">= $(=num(month(date#(v_monthfrom,'MMM')))) <= $(=num(month(date#(v_monthto,'MMM'))))"}>}Sales)

)

For more measures you can replace IF with Pick()-Match().

Not applicable
Author

Hi gysbert, I did'nt kept flag condition in that application..

But i need in that way, In my project app i am having like that

Not applicable
Author

Hi gysbert, I did'nt kept flag condition in that application..

But i need in that way, In my project app i am having like that..

how can i hide other expressions.

kindly help me on this.

Regards,

Helen

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I don't understand what you want. I have no idea what this 'Flag' thing is you're talking about and how that influences the application.


talk is cheap, supply exceeds demand