Reputation: 651
I hope you are well and that you can be of assistance. I have a table and I need calculated columns to show what percentage of 'No' 'Yes' and 'Empty' I have. I have attached a picture below.
Any help with the syntax would be greatly appreciated.
error screenshot posted by Philip Connell:
Upvotes: 0
Views: 4943
Reputation: 651
The solution is below
Count([CUSTOMER_ID]) as [No. Of Customers], Count([CUSTOMER_ID]) THEN [Value] / Sum([Value]) OVER (All([Axis.Columns])) as [Percentage ]
Thank you all for the support
Upvotes: 0
Reputation: 1770
@Philip Connell - I have created a calculated column 'consent%' with the below expression and change the format of this column to percentage from column properties.
[number] / [Total amount]
Used this calculated column in a cross table. Screenshots below.
Please let me know if this is the solution you are looking for.
Refined solution:
I have created some sample data for the sake of explanation.
Added pivot transformation (count of customer ID) while loading sample data into Spotfire.
Created two calculated columns.
Total amount:
Sum([count of Customer_ID]) over ([Country])
consent%:
[count of Customer_ID] / [Total amount]
Upvotes: 2