
1. Re: Using LoDs to calculate percentage of binary outcome
Jyothisree Rayagiri Feb 13, 2018 3:08 AM (in response to Christian R. Houen)3 of 3 people found this helpfulYou do not need LOD for that. You can just do by table calculations
If you do not want the 0,1 in the view, remove the dimension from the view and click on the measure to add a table calculation
Choose 'Percent of total' and edit the calculation to set if you want it by table down/across

2. Re: Using LoDs to calculate percentage of binary outcome
Christian R. Houen Feb 13, 2018 3:19 AM (in response to Jyothisree Rayagiri)1 of 1 people found this helpfulFor learning purposes, I would like to use LOD.
I have found by using the formula
{FIXED [BufferID],[Ordredato]: SUM([Shippet til tiden?])}
I get the number for each '1' in previous graph.Now the challenge is to get this as percentage of total.

3. Re: Using LoDs to calculate percentage of binary outcome
Christian R. Houen Feb 14, 2018 1:45 AM (in response to Christian R. Houen)1 of 1 people found this helpfulI still need help with this issue

4. Re: Using LoDs to calculate percentage of binary outcome
Jyothisree Rayagiri Feb 14, 2018 1:48 AM (in response to Christian R. Houen)1 of 1 people found this helpfulCan you share your workbook please

5. Re: Using LoDs to calculate percentage of binary outcome
Jyothisree Rayagiri Feb 14, 2018 3:20 AM (in response to Jyothisree Rayagiri)1 of 1 people found this helpful 
6. Re: Using LoDs to calculate percentage of binary outcome
Christian R. Houen Feb 14, 2018 3:56 AM (in response to Jyothisree Rayagiri)1 of 1 people found this helpfulBut that is not what I want. As you see on my initial post there is 0 and 1 within each buffer. I want 1/(1+0) as percentage.
Take buffer 1, 'Ordredato' 22. There are 319 0's and 826 1's. I want the percentage of 826/(319+826) in that cell.

7. Re: Using LoDs to calculate percentage of binary outcome
Christian R. Houen Feb 14, 2018 3:58 AM (in response to Jyothisree Rayagiri)1 of 1 people found this helpfulBuffer ID 3 has no 0's, which is why it only shows the number of 1's.

8. Re: Using LoDs to calculate percentage of binary outcome
Jyothisree Rayagiri Feb 14, 2018 4:35 AM (in response to Christian R. Houen)Your LOD is giving you the correct value using sum because only 1's are summed up
0 is not adding to the LOD
You need another LOD to get a total of both 1's and 0's
you can do that by writing an if condition inside the sum
{ fixed [BufferID],[Ordredato]: sum(if isnull([Shippet til tiden?]) then 0 else 1 end )}
or
{ fixed [BufferID],[Ordredato]: sum(if [Shippet til tiden?]=1 or
[Shippet til tiden?]=0 then 0 else 1 end )}
then have a calculated field to get your %
sum([LoD BufferID til tiden])/sum([LoD BufferID til tiden_Total])

4 Ordre.twbx 9.4 MB


9. Re: Using LoDs to calculate percentage of binary outcome
Christian R. Houen Feb 14, 2018 6:19 AM (in response to Jyothisree Rayagiri)1 of 1 people found this helpfulYou're a hero!