
1. Re: How can I translate a WHERE clause for use with calculated fields?
Sherzodbek Ibragimov Nov 15, 2016 1:17 PM (in response to Heather Grebe)Heather,
Without looking into your dataset, have you tried calculation like this?
1. If [Outcome]=1 THEN [PAO] END
2. If [Outcome]=1 THEN [NAO] END

2. Re: How can I translate a WHERE clause for use with calculated fields?
Heather Grebe Nov 15, 2016 11:02 PM (in response to Sherzodbek Ibragimov)This is a great idea....
Further notes on the dataset...
[Outcome] is a categorical string dimension with values '0' and '1'
i tried...
(IF ATTR([Outcome]) = '1' THEN [PAO] END)/(IF ATTR([Outcome]) = '1' THEN [NAO] END)
but it says...
'The table calculation ... requires a field that is missing.....'
Any advice?

3. Re: How can I translate a WHERE clause for use with calculated fields?
Sherzodbek Ibragimov Nov 16, 2016 3:58 AM (in response to Heather Grebe)i see from above picture pao amd Nao are table calculation. Without see your data, please check this thread: How to partition by fields that aren't in the view?

4. Re: How can I translate a WHERE clause for use with calculated fields?
Sherzodbek Ibragimov Nov 18, 2016 6:30 PM (in response to Heather Grebe)Heather,
I just wanted to check back if the link provided above helped you to solve your problem or not? If so, please mark it as correct answer else please post your sample data and we will figure out it for you. Thanks
Sherzod

5. Re: How can I translate a WHERE clause for use with calculated fields?
Heather Grebe Nov 21, 2016 11:09 PM (in response to Sherzodbek Ibragimov)Hi Sherzod,
Thank you for checking back with me, I have been out of town and just now had the chance to check the thread. It does not seem to be what I am aiming at from what I can tell. I have reframed the problem and added an image, details, and my ultimate aim below.
(Detailed pill explanations)
NProportion of Outcome: this is the percent of total number of records calculated across outcome for each val/D source level as a proportion
Total AdmitICD per Outcome: this is a total(sum(number of records)) for each outcome
Total Other AdmitICD10: this is Total AdmitICD per Outcome minus sum(number of records)
(What I am trying to accomplish)
I'd like to be able to have a live odds ratio calculation for each val/D Source level that I can show to an audience independently when they request a specific D Source. The desired equation is as follows:
For each val/D Source combination:
(N): (NProportion of OutcomeOutcome=1)/(NProportion of OutcomeOutcome=0)
(D): (Total Other AdmitICD10Outcome = 1)/(Total Other AdmitICD10Outcome = 0)
Odds Ratio = (N)/(D)

psuedo_data.twbx 1.2 MB
