Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use TOtal Qualifier with 2 dimensions

Hi all, Total is now working in my example.

I need % calc that gives me 10/60 as a % for A-1. for that I am using

sum({<Type ={'Preferred'}>} Amt)/

sum( Total <ProductID>{<Type ={'Preferred'}, [Contract No] ={'*'}>} Amt)

but it only displays correct result in my straight table when both productID & Contract No are selected. I want it to work when only contract No is selected.

Many Thanks

   

ProductIDContract NoAmtType
AA-110Preferred
AA-220Preferred
AA-330Preferred
BB-11Preferred
CC-12Reg
CC-23Reg
5 Replies
sunny_talwar

Try this:

Aggr(Sum({<Type ={'Preferred'}>} Amt)/Sum(Total <ProductID> {<Type ={'Preferred'}, [Contract No] ={'*'}>} Amt), ProductID, [Contract No])

sunny_talwar

Sample attached

Capture.PNG

Anonymous
Not applicable
Author

sunny, Thanks very much for quick reply. the problem is when contract No is not selected, it shows '-', null. when a contract no is selected, your soln works. should I use getfieldselection, ?

sunny_talwar

In the image above, I have not selected any Contract No. I am not sure what you mean?

swuehl
MVP
MVP

You need to specify which dimensions you are using, and if you are using any other specific settings in your application.

Also screen shots, or a more detailed verbal description of what you see when looking where and expecting what would really help to help you.

I assume you are talking about the total line in your straight table chart?

If you want to make your expression work, then try something like:

=sum({<Type ={'Preferred'}>} Amt)/

sum( Total <ProductID>{<Type ={'Preferred'}, [Contract No] ={'*'},ProductID=p()>} Amt)

or

=sum({<Type ={'Preferred'}>} Amt)/

sum( Total <ProductID>{<Type ={'Preferred'}, [Contract No] = ,ProductID=p()>} Amt)

2016-06-10 22_58_44-QlikView x64 - [C__Users_Stefan_Downloads_Community_220429.qvw_].png

2016-06-10 22_59_04-QlikView x64 - [C__Users_Stefan_Downloads_Community_220429.qvw_].png

2016-06-10 22_59_13-QlikView x64 - [C__Users_Stefan_Downloads_Community_220429.qvw_].png