Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
everest226
Creator III
Creator 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
sunny_talwar

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]) & ']'))))

View solution in original post

8 Replies
sunny_talwar

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

everest226
Creator III
Creator III
Author

664518 of 2650572 is 24.95

everest226
Creator III
Creator III
Author

Opps i attached wrong  File . editing soon 

everest226
Creator III
Creator III
Author

Please see the attachment now thanks 

sunny_talwar

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
Creator III
Creator III
Author

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 

sunny_talwar

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]) & ']'))))

View solution in original post

everest226
Creator III
Creator III
Author

Thanks it worked out perfectly .