# "Fixed" Function Behaviour

**Ian Holder**May 20, 2017 1:34 AM

I have Tableau Public at home...if a workbook is needed I'll add one Monday when I'm back at work.

https://public.tableau.com/views/FixedTesting/AllData?:embed=y&:display_count=yes

The *All Data* worksheet shows the data from surveys in Excel plus calculated fields I have added in Tableau. Surveys are unique for *Session* and *Subject*, and a *Subject* is surveyed over multiple sessions. *Q1* was not introduced until the second session.

What I want to do is calculate the number of subjects where *Q1%* is equal to or over 65% [and then do the same for the other questions] and the number where it is less than 65% so I can represent this as a Pie Chart.

*Q1%* is gotten by dividing the value of *Q1* [the number of favourable responses] by the number of responses *Received*:

SUM([Q1])/SUM([Received])

The *Subject and Session* worksheet shows this breakup where my category field [TRUE / FALSE] is:

IF {FIXED [Session + Subject] : [Q1 %] } >= 0.65 THEN

"TRUE"

ELSE

"FALSE"

END

where *[Session + Subject]* is:

[Session] + [Subject]

This appears to work. The values line up with what I expect as per the data on the *All Data* workshet.

However, if I use this formula:

IF {FIXED [Subject] : [Q1 %] } >= 0.65 THEN

"TRUE"

ELSE

"FALSE"

END

, as per the *Subject* worksheet, I get very different values: 3 FALSE and 1 TRUE for each session. The *Subject with Subject* tab shows the problems here.

My first question is, why, when I am grouping by Session, does the second formula not work? And how exactly does it work, and what is it calculating? I understand *Subject* is not unique across my data set, but I thought this would be okay because of the grouping in that there is only one occurrence of each *Subject* per *Session*.

My second question:

This also seems to work:

IF {FIXED [Session], [Subject] : [Q1 %] } >= 0.65 THEN

"TRUE"

ELSE

"FALSE"

END

Is this better than creating a formula as I did for the first function? Or is it the same thing? They both seem to work when I take away *Session* as a grouping and look at the results overall, but I am worrying I am misunderstanding this function so any advice you can give me on how to achieve what I want would be appreciated.

I will add a filter that Q1 >= 1 so I remove the first session once I get this working [see *Filtered Sheet*], but I've left all records in for now to make my counting easier.

Thanks,

Ian.