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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
trishita
Creator III
Creator III

Problem calculating correct percentages

I am getting wrong results for a percentage calculation in qlikview for the 2 fields EURO 80% and HPV BUCHWERT.

I need to calculate two fields to find a percentage of 2 column in a report.How is it possible in qliksense.

I used the script ;

((if (Match([Summary_List.currency],'EUR'), sum([Total Commit]*0.8),
if (Match([Summary_List.currency],'USD'), sum(([Total Commit]/ 1.1452 )*0.8),'Unknown')))/If(Match([Pensionseinrichtung], 'HPK'),
Sum(TOTAL {$<Pensionseinrichtung = {'HPK'}, Stichtag_HPV = {'31.12.2018'}>} [HPV Buchwert]),
If(Match([Pensionseinrichtung], 'HPR ALL'),
Sum(TOTAL {$<Pensionseinrichtung = {'HPR ALL'}, Stichtag_HPV = {'31.12.2018'}>} [HPV Buchwert]),
If(Match([Pensionseinrichtung], 'HPR SMST'),
Sum(TOTAL {$<Pensionseinrichtung = {'HPR SMST'}, Stichtag_HPV = {'31.12.2018'}>} [HPV Buchwert]),
If(Match([Pensionseinrichtung], 'HPR ZF'),
Sum(TOTAL {$<Pensionseinrichtung = {'HPR ZF'}, Stichtag_HPV = {'31.12.2018'}>} [HPV Buchwert])
, 'Unknown'))))
)

Labels (2)
4 Replies
agni_gold
Specialist III
Specialist III

You can directly do , Column(1)/Column(2) and in number formatting change type in percentage
Channa
Specialist III
Specialist III

put  0 instead of 'Unknown'

it is measure

Channa
raman_rastogi
Partner - Creator III
Partner - Creator III

Try This

if (Match([Summary_List.currency],'EUR'), sum([Total Commit]*0.8),
if (Match([Summary_List.currency],'USD'), sum(([Total Commit]/ 1.1452 )*0.8),'Unknown')) )
/
If(Match([Pensionseinrichtung], 'HPK'),
Sum(TOTAL {$<Pensionseinrichtung = {'HPK'}, Stichtag_HPV = {'31.12.2018'}>} [HPV Buchwert]),
If(Match([Pensionseinrichtung], 'HPR ALL'),
Sum(TOTAL {$<Pensionseinrichtung = {'HPR ALL'}, Stichtag_HPV = {'31.12.2018'}>} [HPV Buchwert]),
If(Match([Pensionseinrichtung], 'HPR SMST'),
Sum(TOTAL {$<Pensionseinrichtung = {'HPR SMST'}, Stichtag_HPV = {'31.12.2018'}>} [HPV Buchwert]),
If(Match([Pensionseinrichtung], 'HPR ZF'),
Sum(TOTAL {$<Pensionseinrichtung = {'HPR ZF'}, Stichtag_HPV = {'31.12.2018'}>} [HPV Buchwert])
, 'Unknown'))))
)

Or 

[EURO 80%]/[HPV BUCHWERT]

Or 

column(1)/Column(2)

 

trishita
Creator III
Creator III
Author

i am not getting the option to do it.I could do it in qlikview but not in qliksense. I cant use the new calculated fields created it seems