
1. Re: Calculated column as a difference of table calculations
Sir Oliver Jun 30, 2017 12:33 PM (in response to Sir Oliver)Thank you for this answer Mark. I tried to move the calculation into measures. This is what I got
Calculation1 = SUM([Number of Records]) / TOTAL(SUM([Number of Records])).
How do I create this new column based on the difference between Calculation for Male and Female ?

2. Re: Calculated column as a difference of table calculations
Sir Oliver Jul 3, 2017 10:49 AM (in response to Sir Oliver)I am still not sure how to do this.
Attached is the example similar to the dataset I've got.

Rating_Metrics.twbx 35.8 KB


3. Re: Calculated column as a difference of table calculations
Sir Oliver Jul 11, 2017 1:19 PM (in response to Sir Oliver)I can't beleive no one has a solution for this issue. I know in Qlikview this is as easy as adding Col3 that is equal to Col1  Col2

4. Re: Calculated column as a difference of table calculations
Mark Bradbourne Jul 11, 2017 3:33 PM (in response to Sir Oliver)Sorry, been going through a job transition. I'll take a look tonight

5. Re: Calculated column as a difference of table calculations
Mark Bradbourne Jul 11, 2017 5:40 PM (in response to Sir Oliver)I'm struggling... the Table calc is what's throwing me off... I hate to do this, but Rody Zakovich do you have any ideas?
Mark

6. Re: Calculated column as a difference of table calculations
Hari Ankem Jul 11, 2017 6:07 PM (in response to Sir Oliver)Here you go:
I have changed the formula for Difference and placed the Male Count, Female Count and Difference to the measures, and did a table calculation to display the percentages.

Rating_Metrics.twbx 35.2 KB


7. Re: Calculated column as a difference of table calculations
Hari Ankem Jul 11, 2017 6:09 PM (in response to Sir Oliver)1 of 1 people found this helpfulIt's not that noone has a solution for this. It's just that noone saw it. Usually, if a question has multiple responses, people do not see it because it is assumed that one has already been helped.

8. Re: Calculated column as a difference of table calculations
Okechukwu Ossai Jul 11, 2017 7:04 PM (in response to Sir Oliver)Good solution from Hari Ankem .
Assuming your actual data is structured like this sample data and you want to calculate percentage per Category per rating, then try the formulas below for correct percentage and difference calculation.
[Male %]
SUM(IF [Gender1]="Male" THEN [Number of Records] END)/SUM([Number of Records])
[Female %]
SUM(IF [Gender1]="Female" THEN [Number of Records] END)/SUM([Number of Records])
[Difference]
[Male %]  [Female %]
Hope this helps.
Ossai

9. Re: Calculated column as a difference of table calculations
Sir Oliver Jul 12, 2017 6:04 AM (in response to Hari Ankem)Thank you Hari Ankem
It appears that in this solution  difference column is not giving me the correct difference between male and female pct within a category/rating.

10. Re: Calculated column as a difference of table calculations
Sir Oliver Jul 12, 2017 6:08 AM (in response to Okechukwu Ossai)Osai,
In this solution  you got really close but male and female pct need to go across ratings within a category (as in the example I attached).

11. Re: Calculated column as a difference of table calculations
Hari Ankem Jul 12, 2017 9:40 AM (in response to Sir Oliver) 
12. Re: Calculated column as a difference of table calculations
Sir Oliver Jul 12, 2017 10:28 AM (in response to Hari Ankem)So what I need is a pct difference...say rating E and Category 1: Male is 22% Female is 47%  I need difference to be 25%. For rating E Category 3: Male is 22%, Female is 11%. Difference should be 11%

13. Re: Calculated column as a difference of table calculations
Hari Ankem Jul 12, 2017 11:11 AM (in response to Sir Oliver)
Rating_Metrics.twbx 58.6 KB
