From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarmo Hurri Subject: Re: [PATCH] Lookup functions, take two Date: Mon, 24 Sep 2012 20:33:29 +0300 Message-ID: <87fw67s4uu.fsf@syk.fi> References: <87y5k0g3qc.fsf@syk.fi> <878vbzo6yu.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGCXS-0001sA-18 for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 13:33:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGCXO-0001Nq-Fa for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 13:33:45 -0400 Received: from plane.gmane.org ([80.91.229.3]:44362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGCXO-0001NY-8X for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 13:33:42 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TGCXQ-0000Ue-1e for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 19:33:44 +0200 Received: from cs181237063.pp.htv.fi ([82.181.237.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Sep 2012 19:33:44 +0200 Received: from jarmo.hurri by cs181237063.pp.htv.fi with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 24 Sep 2012 19:33:44 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Bastien writes: > I feel my brain is a bit slow today... so sorry in advance if the > question sounds stupid. What is the advantage of using org-lookup-* > functions instead of a simple reference in the table formulas? As noted in the documentation, most often you do something like this when fetching data from another table (in the case of org, using remote). I would preferred to include cases like this, but the tblfm-lines were too long for the resulting PDF... Say I have 100 students, and I want to grade them. I find the sum of their marks, and then have a grading table for the grades. The lookup function maps the marks to the grades, as shown in documentation in the second example. Another application would be, say, mapping your postal code to your municipality. The "user" would input the postal code, and the table would automatically fetch the corresponding municipality from another table. A third example would be a discount rate that depends on the total sum of your bill. Or a bonus that depends on how productive you were (given as a table by the suits). M*crosoft equivalents, supported by libreoffice, are the hlookup and vlookup functions: http://help.libreoffice.org/Calc/Spreadsheet_Functions#VLOOKUP -- Jarmo