Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
ProductID | Contract No | Amt | Type |
A | A-1 | 10 | Preferred |
A | A-2 | 20 | Preferred |
A | A-3 | 30 | Preferred |
B | B-1 | 1 | Preferred |
C | C-1 | 2 | Reg |
C | C-2 | 3 | Reg |
Try this:
Aggr(Sum({<Type ={'Preferred'}>} Amt)/Sum(Total <ProductID> {<Type ={'Preferred'}, [Contract No] ={'*'}>} Amt), ProductID, [Contract No])
Sample attached
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, ?
In the image above, I have not selected any Contract No. I am not sure what you mean?
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)