Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
devarasu07
Master II
Master II

Sum of Total amount % in qlikview?

Hi All,

Trying to achieve Amt% based on year and country filter, any idea/suggestion to resolve this formula issue. Thanks

Used below formula to get Amt%

=(Sum({<Country={$(vCountry)},Year={$(vCurrYear)}>}amt)/sum(amt))*100

and got below output (Amt% column wrong results showing)

current_output.JPG

   

expected output is like below Amt% column values

Sum of Total %.JPG

1 Solution

Accepted Solutions
sunny_talwar

You did not have a variable called vCurrYear in your app. This worked:

=Sum({<Country={$(=vCountry)}, Year={$(=vYear)}>} amt)/Sum(TOTAL {<Country={$(=vCountry)},Year={$(=vYear)}>} amt)

Capture.PNG

View solution in original post

8 Replies
Anonymous
Not applicable

Hi

try this

=(Sum({<Country={$=(vCountry)},Year={$=(vCurrYear)}>}amt)/sum(amt))*100

sunny_talwar

May be this:

=Sum({<Country={$(vCountry)},Year={$(vCurrYear)}>} amt)/Sum(TOTAL {<Country={$(vCountry)},Year={$(vCurrYear)}>} amt)

devarasu07
Master II
Master II
Author

! ! !!Hi Sunny,

I've tried with your suggested formula and still shows wrong result, please find the attached document. Thanks

devarasu07
Master II
Master II
Author

Hi Allu,

Tried with your updated formula and still it's gave "-" like that. please advise. Tks

sunny_talwar

You did not have a variable called vCurrYear in your app. This worked:

=Sum({<Country={$(=vCountry)}, Year={$(=vYear)}>} amt)/Sum(TOTAL {<Country={$(=vCountry)},Year={$(=vYear)}>} amt)

Capture.PNG

Not applicable

Hi Devasaru,

You are using vYear for storing year but you are using vCurrYear in expression. Please change either one.

Also, you don't need to put vCountry as 'Norway' (with quotes), you can keep it as Norway only.

Hope it helps.

Regards,

Sakir

devarasu07
Master II
Master II
Author

Hi Sunny,

Thanks for your valuable input, can you suggest me to overcome

"Please note: your content was added successfully, but a moderator needs to approve it before it can be posted." this messeage issue while post new thread into new to qlikview forum.