Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

everest226
Contributor III

Percentage issue,

So i have a table bellow are the column and expression . Some how percentages total label is incorrect where as by category is correct   

Column 1 Total

if(Sum({< Is={'T'}, [ CAT Name] = {'T I'} >} [ Sold] )>0,
Sum({< Is={'T'}>} [Sold] ))

 

Column 2  GRE

if(Sum({< Is={'T'}, [CAT Name] = {'T I'} >} [ Sold] )>0,
Sum({< Is={'T'}, [CAT Name] = {'T I'} >} [ Sold] ))

 

total percentages 

if(Sum({< Is={'T'}, [CAT Name] = {'T I'} >} [ Sold] )>0,
Sum({< Is={'T'}, [CAT Name] = {'T I'} >} [Sold] ) / Sum({< Is={'T'} >} [Sold] ))

1 Solution

Accepted Solutions
Highlighted

Re: Percentage issue,

May be this

Sum({<Is={'T'}, [CAT Name] = {'T I'}>} [ Sold])
/
Sum(Aggr(
  If(Sum({< Is={'T'}, [ CAT Name] = {'T I'} >} [ Sold]) > 0, Sum({<Is={'T'}>} [Sold]))
, $(='[' & GetCurrentField([Group Name]) & ']'))))
8 Replies

Re: Percentage issue,

What is wrong? If 18.1% is not right then what is right?

everest226
Contributor III

Re: Percentage issue,

664518 of 2650572 is 24.95

everest226
Contributor III

Re: Percentage issue,

Opps i attached wrong  File . editing soon 

everest226
Contributor III

Re: Percentage issue,

Please see the attachment now thanks 

Re: Percentage issue,

Try this

Sum({<Is={'T'}, [CAT Name] = {'T I'}>} [ Sold])
/
Sum(Aggr(
If(Sum({< Is={'T'}, [ CAT Name] = {'T I'} >} [ Sold]) > 0, Sum({<Is={'T'}>} [Sold]))
, Dimension))
everest226
Contributor III

Re: Percentage issue,

Thanks Sunny, it  worked perfectly , however it has Cycle group  dimension , so it only works for one dimension . is there a way to works in all dimension 

Highlighted

Re: Percentage issue,

May be this

Sum({<Is={'T'}, [CAT Name] = {'T I'}>} [ Sold])
/
Sum(Aggr(
  If(Sum({< Is={'T'}, [ CAT Name] = {'T I'} >} [ Sold]) > 0, Sum({<Is={'T'}>} [Sold]))
, $(='[' & GetCurrentField([Group Name]) & ']'))))
everest226
Contributor III

Re: Percentage issue,

Thanks it worked out perfectly .