Cant get a sample custom field to work

I created 2 Sample, Real CFs width 12 precision 6 called Value_One and Value_Two. I enter values in the sample set for example 45.8977 in Value_One and 12.0901 in Value_Two and then I created a third CF Sample Real Calculated (again Width of 12 precision of 6) called Difference. I want the values for Difference to be the same as the value in Sampleweight so I coded a Sample Bool CF as EQ(Sampleweight,Difference) and the translations as Yes and No.


But for some odd reason, only about 1/3 of my values are showing up as Yes even when the values for Difference and Sampleweight are the exact same. I cant see whats different between these values. Oddly when I throw in clean values like 20 and 10 and the difference is 10, then this always equates to Yes when I put 10 in the Sampelweight but my values aren't clean and are typically 58 to 68 to 4 decimal places, so 58.9087 or 66.0091 etc. I cant understand why, when the values are the same, its not translating to Yes. I tried changing the name of the CF and the order so EQ(Difference, Samplweight) but nothing seems to be changing the random nature of the Yes or No...

Anyone any insight into this please?

Answers

  • What I'd try: Rename the 3rd one either "X_Difference" or "difference" and see if a Summarize Custom fields line will fix this on processing the set. My suspicion is that Empower is not dealing with the V... CFs until after the D... named CF has been "calculated" because of the ordering rules (alphabetical, capitalized before lower case...). I have no idea about the other inconsistencies. They may or may not be related.
  • Yeah i was thinking the naming of the CFs might be the issue so i renamed them as A_Valueone and B_Valuetwo and the third Sample Real Calculated cf as A_Valueone-B_Valuetwo and i called this CF X_Difference so that this field is populated before the Sampleweight comparison. So i created a 4th CF sample bool calculated called  T_Comparison as EQ(Sampleweight,X_Difference) with translations of Yes and No

    So i started putting in random values for value 1 and 2 eg 68.0087-32.0007 and X_Difference worked fine but...again when i transcribed these values into the Sampleweight column i get 3 working ok followed by 2 not fine then 4 fine and 4 not fine. Completely random and i know for a fact the two numbers are the same i even have the same width and precisiom for X_Difference than i do Samplweight. Its driving me mad and i cannot figure out what im doing wrong. Should i maybe change to T_Difference then X_Comparison so all values are populated before the comparison kicks in? Any help is much appreciated thanks!
  • It might be considering Sample Weight after T_Difference... maybe P_Difference?
  • I tried it with P_Difference too and its still not working, random Yes and No. I think this has something to do with the fact that Sampleweight is a default CF so may not behave as predicted. Because when I compare the difference to a different CF it all works perfectly..
  • Something to explore: did you try creating this a Component type CF? 
  • Hi medicnman i dont think component type fields can do calculations like one value minus another value, they are typically only for further peak cfs. Im not 100% on that though so ill try tomorrow.
    The odd thing is i created a sample real cf called Difference and then a sample bool called Comparison and coded it as EQ(Comparison, Difference) and when i typed the values that i got from Difference into Comparison i got a Yes every time no issue and this was even when Difference and Comparison had different precisions which didnt make a difference.

    Im guessing Sampleweight is a default cf and wont behave the same as another cf when comparing 2 values. Cant think of anything else..unless the project or sample set is corrupt. 
  • Precision is just what's shown, has nothing to do with the values of the numbers.
  • Yes i know, i thought it might be a factor.

    Turns out this is a complete mystery to me. It only returns Yes when the 2 values are clean like 12 - 6 or 56-54 but not 12.9870 - 3.0963 etc.
    No idea whats causing it. Tried different naming for the CF tried adding summarize custom fields. This is random even on fields which dont calculate the value so if anyone can brainstorm this issue id love to know!