AnsweredAssumed Answered

Calculated field: = x WHEN y IS z

Question asked by BenT on Jun 3, 2015
Latest reply on Jun 3, 2015 by philmodjunk

Title

Calculated field: = x WHEN y IS z

Post

All,

I've connected to a MySQL server am I'm trying to map the SKU variable I have in Filemaker, to the one online. The online server stores the SKU, and other variables like stock in a weird way:

meta_id ______ post_id _______ meta_key ________ meta_value

121917 _______ 7756 __________ _sku ___________ 43060

121918 _______ 7756 _________ _stock ___________ 10

 

I made a field that is a calculation and used "If ( meta_key = "_sku" ; meta_value ), however, no matter what I do, it will always display the meta_value independent of the key.

 

I need Filemaker to know that the meta_key is related to the meta_value. And I need to be able to do a calculation that gives meta_value WHEN meta_key EQUALS a given value. 

 

It's worth noting that the meta_id is a unique field, and I believe I could use that to relate them all, but I don't what that value is, hence why I need a calculation to find the value when meta_key equals a certain value.

 

I figured there would be a "WHEN" function in the Filemaker Calculation, but I haven't seen it... Any recommendations?

Outcomes