0, "yes", "") - prints "yes" if a meal is planned at least once in Meal Plan - Times Planned is a rollup value that counts the number of times the recipe occurs in Meal Plan ∑ In stock? : if(not empty(prop("Ingredients")) and not contains(prop("Ingredient status"), "no"), "yes", "") - prints "yes" if a recipe has ingredients listed, and none of those ingredients are out of stock in Grocery - Ingredients is a relation to the Grocery database. Ingredients are manually added. - Ingredient status is an ugly rollup that lists the stock status of each ingredient (options: "yes", "low", "to prep", "no") Σ N out of stock : (length(prop("Stock status")) == 0) ? 0 : (length(replaceAll(replaceAll(prop("Ingredients status"), "low(,)?|Yes(,)?|to prep(,)?", ""), "[^,]", "")) + if(slice(prop("Stock status"), -2) == "no", 1, 0)) - calculates the number of ingredients for a given recipe that are out of stock - Translation: 1. if the there are no ingredient statuses in Ingredients status, print 0 out of stock. 2. Otherwise, replace all instances of "low" and "yes" statuses and their trailing commas with sad emptiness (remove them so that only no,no, remains), 3. then replace all non-"," characters with sad emptiness (remove them so that only commas remain, e.g. ,,), 4. and take the length of that string. This is the number of commas that followed "no" statuses in the Ingredients status list. 5. If the last status of the list was "no", it will not have a trailing comma, so add one (1) to the count. - Ingredients status is a rollup that lists the status of all related ingredients from the Grocery database Σ % in stock : empty(prop("Ingredients")) ? 0 : ((prop("Ingredient count") - toNumber(prop("N out of stock"))) / prop("Ingredient count")) - returns the proportion of ingredients that are not out of stock as a percent - Translation: If there are no linked ingredients, print 0%. Otherwise calculate the number of in-stock ingredients as total - number out of stock. Divide by the total number of ingredients to get the proportion in stock. - Ingredients is a relation to the Grocery database. Ingredients are manually added. - Ingredient count is a rollup that counts the total number of unique ingredients added in the Ingredients relation - N out of stock is a formula described above calculating the # of related ingredients that are out of stock in the Grocery database. * Note: if you add to or change the "stock status" values in the Grocery database from "yes", "low", and "no", you will need to update them in these formulas as well"> 0, "yes", "") - prints "yes" if a meal is planned at least once in Meal Plan - Times Planned is a rollup value that counts the number of times the recipe occurs in Meal Plan ∑ In stock? : if(not empty(prop("Ingredients")) and not contains(prop("Ingredient status"), "no"), "yes", "") - prints "yes" if a recipe has ingredients listed, and none of those ingredients are out of stock in Grocery - Ingredients is a relation to the Grocery database. Ingredients are manually added. - Ingredient status is an ugly rollup that lists the stock status of each ingredient (options: "yes", "low", "to prep", "no") Σ N out of stock : (length(prop("Stock status")) == 0) ? 0 : (length(replaceAll(replaceAll(prop("Ingredients status"), "low(,)?|Yes(,)?|to prep(,)?", ""), "[^,]", "")) + if(slice(prop("Stock status"), -2) == "no", 1, 0)) - calculates the number of ingredients for a given recipe that are out of stock - Translation: 1. if the there are no ingredient statuses in Ingredients status, print 0 out of stock. 2. Otherwise, replace all instances of "low" and "yes" statuses and their trailing commas with sad emptiness (remove them so that only no,no, remains), 3. then replace all non-"," characters with sad emptiness (remove them so that only commas remain, e.g. ,,), 4. and take the length of that string. This is the number of commas that followed "no" statuses in the Ingredients status list. 5. If the last status of the list was "no", it will not have a trailing comma, so add one (1) to the count. - Ingredients status is a rollup that lists the status of all related ingredients from the Grocery database Σ % in stock : empty(prop("Ingredients")) ? 0 : ((prop("Ingredient count") - toNumber(prop("N out of stock"))) / prop("Ingredient count")) - returns the proportion of ingredients that are not out of stock as a percent - Translation: If there are no linked ingredients, print 0%. Otherwise calculate the number of in-stock ingredients as total - number out of stock. Divide by the total number of ingredients to get the proportion in stock. - Ingredients is a relation to the Grocery database. Ingredients are manually added. - Ingredient count is a rollup that counts the total number of unique ingredients added in the Ingredients relation - N out of stock is a formula described above calculating the # of related ingredients that are out of stock in the Grocery database. * Note: if you add to or change the "stock status" values in the Grocery database from "yes", "low", and "no", you will need to update them in these formulas as well"> 0, "yes", "") - prints "yes" if a meal is planned at least once in Meal Plan - Times Planned is a rollup value that counts the number of times the recipe occurs in Meal Plan ∑ In stock? : if(not empty(prop("Ingredients")) and not contains(prop("Ingredient status"), "no"), "yes", "") - prints "yes" if a recipe has ingredients listed, and none of those ingredients are out of stock in Grocery - Ingredients is a relation to the Grocery database. Ingredients are manually added. - Ingredient status is an ugly rollup that lists the stock status of each ingredient (options: "yes", "low", "to prep", "no") Σ N out of stock : (length(prop("Stock status")) == 0) ? 0 : (length(replaceAll(replaceAll(prop("Ingredients status"), "low(,)?|Yes(,)?|to prep(,)?", ""), "[^,]", "")) + if(slice(prop("Stock status"), -2) == "no", 1, 0)) - calculates the number of ingredients for a given recipe that are out of stock - Translation: 1. if the there are no ingredient statuses in Ingredients status, print 0 out of stock. 2. Otherwise, replace all instances of "low" and "yes" statuses and their trailing commas with sad emptiness (remove them so that only no,no, remains), 3. then replace all non-"," characters with sad emptiness (remove them so that only commas remain, e.g. ,,), 4. and take the length of that string. This is the number of commas that followed "no" statuses in the Ingredients status list. 5. If the last status of the list was "no", it will not have a trailing comma, so add one (1) to the count. - Ingredients status is a rollup that lists the status of all related ingredients from the Grocery database Σ % in stock : empty(prop("Ingredients")) ? 0 : ((prop("Ingredient count") - toNumber(prop("N out of stock"))) / prop("Ingredient count")) - returns the proportion of ingredients that are not out of stock as a percent - Translation: If there are no linked ingredients, print 0%. Otherwise calculate the number of in-stock ingredients as total - number out of stock. Divide by the total number of ingredients to get the proportion in stock. - Ingredients is a relation to the Grocery database. Ingredients are manually added. - Ingredient count is a rollup that counts the total number of unique ingredients added in the Ingredients relation - N out of stock is a formula described above calculating the # of related ingredients that are out of stock in the Grocery database. * Note: if you add to or change the "stock status" values in the Grocery database from "yes", "low", and "no", you will need to update them in these formulas as well">