This is my query. How do I calculate market share%?
DEFINE FILE T1
MAKE1/A20 = IF MAKE EQ 'COMPANY1' THEN 'C1' ELSE 'C2';
END
TABLE FILE TEMP1
SUM
QTY
BY SEGMENT
BY MAKE1
BY PERIOD
END
so, I get the sum of quantities of Company1 and all others by segment, make. How do I get market share % which means for company1, I need all company1 sum of quantities divided by all other companies quantities * 100.
Thank you..This message has been edited. Last edited by: Kerry,
8.1.05 HTML,PDF,EXL2K, Active, All
February 21, 2011, 03:13 PM
Enigma006
got it to work.. thanks
8.1.05 HTML,PDF,EXL2K, Active, All
February 24, 2011, 01:17 PM
Kerry
Hi Enigma,
Glad to know it works now. Would you mind post the solution? Thank you in advance for sharing.
Cheers,
Kerry
Kerry Zhan Focal Point Moderator Information Builders, Inc.
February 24, 2011, 01:48 PM
jseaburn
Yes! I would be interested in this solution as well. I do the same thing in one of my procedures, but I think my code is more complicated than it needs to be, so I'm curious if there's a better way.
WebFOCUS 7.7.03 Linux / Universe Db HTML/PDF/EXCEL/HTML Active
February 28, 2011, 03:47 PM
Enigma006
I used TOT.FIELD1 which created a new field with the total of FIELD1. And I used FIELD1/TOT.FIELD1 * 100 to create %