How Fuzzy score and Score() function works in HANA?

Hi,
I read fuzzy developer guide of HANA, but i am not getting how HANA calculate score() and fuzzy score?
As per developer guide, Score() is calculate using TF/IDF, and I also try to calculate TF/IDF as per WIKI page, but it gives different values. and Score() value is changed as per x value of fuzzy(x) .
See example
select score() as sc, *
from COMPANIES2
where contains(Companyname,'IBM',fuzzy(0.7))
it returns
SC;                             ID; COMPANYNAME;  CONTACT
0.7599999904632568;   6;  IBM Corp;               M. Master
and for
select score() as sc, *
from COMPANIES2
where contains(Companyname,'IBM',fuzzy(0.2))
it return
SC;                               ID;  COMPANYNAME;       CONTACT
0.16945946216583252;   2;   SAP in Walldorf Corp;  Master Mister
0.8392000198364258;     6;   IBM Corp;                   M. Master
and table content of Companies2 is
ID; Companyname;           contact
1;  SAP Corp;                   Mister Master
2;  SAP in Walldorf Corp;   Master Mister
3;  ASAP;                         Nister Naster
4;  ASAP Corp;                 Mixter Maxter
5;  BSAP orp;                   Imster Marter
6;  IBM Corp;                    M. Master
Please provide any formula or algorithm for above.
Thanks,
Somnath A. Kadam

Hi Somnath,
It seems that the column "Companyname" has data type "SHORTTEXT" and here is the quote from SAP HANA Developer Guide Ch. 10.2.4.8 (p659)
"Text types support a more sophisticated kind of fuzzy search. Texts are tokenized (split into terms), and the fuzzy comparison is performed term by term.
When searching with 'SAP' for example, a record like 'SAP Deutschland AG & Co. KG' gets a high score, because the term 'SAP' exists in both texts. A record like 'SAPPHIRE NOW Orlando' gets a lower score, because 'SAP' is just a part of the longer term 'SAPPHIRE' (3 of 8 characters match)."
So for text columns the score calculation is much more complex than tf-idf.
As for the different fuzzy score, there is an explanation in the FAQ section ( Ch. 10.2.4.14, p736 "Is the score between request and result always stable for TEXT columns?")
Basically, for each token, its similarity score will be used to calculate the overall result only if it is higher than the threshold given in fuzzy(). Any token with a lesser similarity score will be excluded. Therefore, slight change in the threshold may influence the overall score greatly.
Here is an example.
I added id 7 "SAP ASAP" to the data you used.
Note that the similarity score between "ASAP" and "BSAP" is slightly over 0.74 and similarity score between "SAP" and "BSAP" is 0.75:
For
    select score() as sc, * from COMPANIES2  where contains(COMPANYNAME,'BSAP',fuzzy(0.74))
We get:
<...omitted...>
0.7474510073661804;    7;    SAP ASAP;        M. Master
Now change the  threshold to 0.75 and the result is:
<...omitted...>
0.5588234663009644;    7;    SAP ASAP;        M. Master
ID 7 now gets a lower score because "ASAP" is excluded and only "SAP" is used to calculate the overall result.
As for tf-idf, it is used in the so-called freestyle search across multiple columns.
An example from the same guide:
     select score() as sc, * from companies2 where contains((companyname,contact), 'IBM Master', FUZZY(0.7));
Result:
0.8103122115135193;    6;    IBM Corp;    M. Master
Regards
Roger Tao

Similar Messages

  • How score() function works in HANA fuzzy search

    Hi, i am confused by the score() returned value when i use this in fuzzy search in HANA
    CREATE COLUMN TABLE test_similar_calculation_mode
    ( id INTEGER PRIMARY KEY, s text);
    INSERT INTO test_similar_calculation_mode VALUES ('1','stringg');
    INSERT INTO test_similar_calculation_mode VALUES ('2','string theory');
    INSERT INTO test_similar_calculation_mode VALUES ('3','this is a very very very long string');
    INSERT INTO test_similar_calculation_mode VALUES ('4','this is another very long string');
    SELECT TO_INT(SCORE()*100)/100 AS score, id, s FROM test_similar_calculation_mode WHERE CONTAINS(s, 'theory', FUZZY(0.9, 'similarCalculationMode=compare')) ORDER BY score DESC;
    the returned list is just as below
    SCORE      ID      S
    0.84            2       string theory
    why i assign 0.9 as threshold in fuzzy function while this line with score 0.84 also be returned.
    from my understanding, the S field is text data type, so the string actually is divided into seperate word list, so the score should be 1.0, is it right?
    any hints is very appreciate,thanks

    Hi William,
    By default the score() function returns a TF/IDF score for text data types.
    To get back the fuzzy score, you have to use the search option 'textSearch=compare' (or 'ts=compare'). Without other options, this gives an average score of all tokens ('string' and 'theory') and you get a score of 0.7 as a result.
    To ignore the additional token 'string' in the database, you have to specify another option that tells the score function to use the tokens from the user input only ('cnmt=input').
    So you should use
    TO_INT(SCORE()*100)/100 AS score, id, s
    FROM test_similar_calculation_mode
    WHERE CONTAINS(s, 'theory', FUZZY(0.9, 'scm=compare, ts=compare, cnmt=input'))
    ORDER BY score DESC;
    to get the expected results.
    Regards,
    Jörg

  • GRC - Role Expert v5.2: how does the Transaction Usage functionality work

    Hi All,
    re: GRC - Role Expert v5.2: how does the Transaction Usage functionality work
    We are implementing GRC suite v5.2, but specifically my question is regarding Role Expert:
    SAP documentation states that it is possible to use Role Expert to do the following: for roles allows you to see if, or how much, a transaction is being used, when it was last used, and who used it.
    My question is how without Audit Log or RBE?
    Let me know if you have ever used this functionality and if it requires the SAP Back-End Audit Log to be turned on or RBE.
    Thanks in advance!

    Hi Gary,
    You dont need a RBE tool activation to get the successful transaction usage log with Role Expert.
    Role Expert functionality allows you to log all the transactions that have been added/deleted to the role that is changed. Also when you create a new role via the Role Expert then automatically the transaction log starts.
    If you go the "History" tab in the Role Expert, then you can find all the last changes made to the role.
    Also you can go to the "Risk Analysis" tab to find the log of Risk Analysis performed with the added tcodes.
    Hope this helps.
    Thanks,
    Kiran Kandepalli.

  • I have been using Voice memos for some time but now I get a message to say No Microphone Available how do I get the function working again?

    I have been using Voice memos for some time but now I get a message to say No Microphone Available how do I get the function working again?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • When I try to send a link to a page from Safari, I get a message saying that sending the message to the server failed.  It places a copy in the outbox.  All other email and safari functions work properly.  Ipad 2 IOS 7.1

    My Ipad2 works fine except when I try to email myself a link to a safari webpage.  I get an error message saying that the message failed to connect to the server.  It says that a copy of the message has been left in the outbox.  I cannot get the message from the outbox.  All other email and safari functions work as expected.
    I have cleared data and cookies, powered down, and done a reset.  Nothing seems to help.

    Typing in additional text seems to get the job done.  This seems to be a feature of the latest IOS update, I have never had the problem before the last update.
    I use the box with the arrow just to the left of the URL block at the top of the page to send myself links to pages of interest.  Adding the extra text seems like a pointless step, but it does work.
    Thanks.

  • I cant get the font to work on a picture in Photoshop, I have watched at least 12 how to videos and it wont work, Help

    I cant get the font to work on a picture in Photoshop, I have watched at least 12 how to videos and it wont work, Help

    Could you capture your screen and post it. Have the layers panel open and any layers that are collapsed, expanded. We will need to see the entire screen, as some information in the tab is important as well.

  • LRv3.2 Networking with an Asst , How to store and retrieve updated work on Win7?

    LRv3.2 Networking with an Asst , How to store and retrieve updated work on Win7 Network?
    We have a working 1gig network in Win7 PRO 64-bit.  and using LRv3.2
    * How do I configure our Files or Cataloges "so"  ALL Edits are veiwable/edit to all?   (we don't work on the Same Shoot/Folder at the same time)
    I NEED to see,  ALL the LR  Edits  (is great with DNG files
    *** BUT,  what I cannot see if I remember correctly (with just the DNG sharing)  is the  CROP or Virtual Copys ... possibly the Brush edits.
    HOW, do I configure to be able to read and edit ...  ALL of the updated/saved  Edits???   (after it is done by my asst.)
    Is creating a New Catalog for EACH  shoot the way to go?   (not sure I like this idea)
    Right now everything is in one(1) catalog  ... and it's getting big ... BUT, this allows us to search , and group ... going way back.
    Would be nice to be able to still do this easily, and with what we have already done.
    With our one BIG Catalog ... not sure if two(2) can access this catalog over the Network at the same time?
    Even though we never Edit the Same Folder or Files at the same time.
    Or will that be a problem over a simple Win7 PRO network?
    Thank you,
    HG

    Aloha Bob,
    Saw your link.  thank you.
    At least I don't feel "alone"  LOL
    At this point ... I am looking for a  "cluncky"   Work Around?
    * I was thinking,  Maybe making a copy of  My Cataloge ...
    Deleting ALL the  Folders in LR  ... except for the one's  that  will be worked by the Asst.
    Then moving that file to the  Asst.  Computer.
    * NEXT,  pointing the  Folder that they are working on ... across the Network to the Servers Files.
    * After they work on it:
    *** IS THERE A WAY ...
    * To  take that Cataloge ... and UPDATE  my Main  Cataloge.
    THIS, is the STEP  ... I don't know how to do.
    Can someone Help me with this?
    Step by Step,  because I am clueless ....
    Talking UPDATE of everything worked on ... including   Virtual copys, and  CROPS.
    Thank you,
    HG

  • How do icloud and itunes match work with multiple libraries?

    How do icloud and itunes match work with multiple libraries?

    This forum is for troubleshooting compatibility issues between Macs and Windows, not iTunes. You'll probably want to repost your question in the iTunes discussions:
    http://discussions.apple.com/category.jspa?categoryID=150

  • How the try and catch blocks work?

    For the following section of code from the class QueueInheritanceTest...how the try and catch blocks work?
    The Class...
    public class QueueInheritance extends List {
    public QueueInheritance() { super( "queue" ); }
    public void enqueue( Object o )
    { insertAtBack( o ); }
    public Object dequeue()
    throws EmptyListException { return removeFromFront(); }
    public boolean isEmpty() { return super.isEmpty(); }
    public void print() { super.print(); }
    Testing...
    public class QueueInheritanceTest {
    public static void main( String args[] ){
    QueueInheritance objQueue = new QueueInheritance();
    // Create objects to store in the queue
    Boolean b = Boolean.TRUE;
    Character c = new Character( '$' );
    Integer i = new Integer( 34567 );
    String s = "hello";
    // Use the enqueue method
    objQueue.enqueue( b );
    objQueue.enqueue( c );
    objQueue.enqueue( i );
    objQueue.enqueue( s );
    objQueue.print();
    // Use the dequeue method
    Object removedObj = null;
    try { while ( true ) {
    removedObj = objQueue.dequeue();
    System.out.println(removedObj.toString()+" dequeued" );
    objQueue.print();
    catch ( EmptyListException e ) {
    System.err.println( "\n" + e.toString() );

    If you want a basic introduction to try/catch blocks, read any introductory text or the tutorials on this site.
    Here are some:
    Sun's basic Java tutorial
    Sun's New To Java Center.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns."
    In terms of this particular case, it looks like the code is using an exception being thrown to get out of a loop. IMHO that's bad design -- exceptions should be used for exceptional circumstances, and if you use it to get out of a loop, then you're certain it's going to happen, and that means that it's not exceptional.
    When you post code, please wrap it in  tags so it's legible.

  • How to make an onKeyPressed function work

    Hi, i have some problems with making the onkeyPressed function work. Somehow when i run it, it complains about "'static' is no longer supported. It will be removed from the language soon. Use script-level declarations for Right ". So i need to get around it. Here's the code. Make an image or replace an image with spacecraft.png.
    var frame = 0;
    var spaceship: ImageView;
    var Spaceship = Image { url: "{__DIR__}spacecraft.png" }
    var KeyX: Number = 100;
    var KeyY: Number = 100;
    var offsetX: Integer;          // Possible values are -1, 0 and 1
    var offsetY: Integer;
    var x;
    var MoveLeft;
    var MoveUp;
    var MoveDown;
    var transition: Transition;
    Stage {
    visible: true
    title: "Spaceship"
    scene: Scene {
    width: 250
    height: 200
    content: [
    ImageView {
    image: Spaceship
    onKeyPressed: function(e: KeyEvent): Void {
    if (e.code == KeyCode.VK_RIGHT) {
    Move.Right
    if (e.code == KeyCode.VK_LEFT) {
    var y: Number = 200;
    var X: Number = 200;
    // Timeline updates y variable
    static class Move extends CustomNode {
    var image: Image;
    var transition: Transition;
    var fitWidth: Number;
    static var Right = Move {
    image: Spaceship
    translateX: 300
    translateY: 100
    fitWidth: 150
    transition: TranslateTransition {
    duration: 2s
    byX: 250 repeatCount: Timeline.INDEFINITE
    autoReverse: true
    }

    I tried the node.requestFocus(), but apparently, their is a new error when I ran it . It said "java.lang.StackOverflowError" with many at errors following it .Here our my fx codes. If you run it on your IDE, it should say the same error.
    Main.Fx
    Stage {
        visible: true
        title: "Spaceship"
        scene: Scene {
            width: 250
            height: 200
            content: [Move {}]
    }Move.fx
    var y: Number = 200;
    var X: Number = 200;
    var Spaceship = Image { url: "{__DIR__}spacecraft 2 png.png" }
    // Timeline updates y variable
    public class Move extends CustomNode {
        var image: Image;
        var transition1: Transition;
        var fitWidth: Number;
        var Right = Move {
                    image: Spaceship
                    translateX: 300
                    translateY: 100
                    fitWidth: 150
                    transition1: TranslateTransition {
                        duration: 2s
                        byX: 250 repeatCount: Timeline.INDEFINITE
                        autoReverse: true
    public override function create(): Node {
            //Assign Group to variable
            var myGroup = Group {
                        content: [Move.Right
                        focusTraversable: true
                        onKeyPressed: function(e: KeyEvent): Void {
                            if (e.code == KeyCode.VK_RIGHT) {
                                Move.Right;
                                transition1.play()
                        onKeyReleased: function(e: KeyEvent): Void {
                           if (e.code == KeyCode.VK_RIGHT) {
                                Move.Right;
                                transition1.pause()
                    } //Group
            myGroup.requestFocus(); //This sets the focus on the group that is to be returned and put onto the stage
            return myGroup
    }

  • Help w/MaxDB Function; also: how does the "Debug SQL" function work?

    Hi there forum folks,
    In my former life, I was a Basis guy, but I haven't had the pleasure of working directly with SAP applications in a few months.  My current project is to attempt to use MaxDB in a real estate environment.  We're tracking home listings so that we can build statistical reports... such as "what agents are in the Top 100 in postal code X?"
    Anyway, as part of this project, I have attempted to construct my very first MaxDB database function.  Unfortunately, it doesn't give me the answers I'm hoping to see.  Here's the function:
    CREATE FUNCTION COUNT_LISTINGS (AGENTID CHAR(10)) RETURNS FIXED(6,1) AS
      VAR COLISTINGAGENTID CHAR(10);
          LISTINGAGENTID   CHAR(10);
          MLSNUMBER        CHAR(7);
          UNITS            FIXED(6,1);
      SET UNITS = 0;
      DECLARE FUNCTIONRESULT CURSOR FOR
        SELECT MLSNUMBER,
               LISTINGAGENTID,
               COLISTINGAGENTID FROM FREDDIE.GLAR_SOLDS
         WHERE LISTINGAGENTID = :agentid OR COLISTINGAGENTID = :agentid;
      IF $COUNT IS NULL THEN
        BEGIN
          CLOSE FUNCTIONRESULT;
          RETURN UNITS;
        END
      ELSE
        SET $RC = 0;
      WHILE $RC = 0 DO BEGIN
        FETCH FUNCTIONRESULT INTO :mlsnumber, :listingagentid, :colistingagentid;
        IF ( LISTINGAGENTID   = AGENTID AND COLISTINGAGENTID IS NULL ) OR
           ( COLISTINGAGENTID = AGENTID AND LISTINGAGENTID   IS NULL ) THEN
          SET UNITS = UNITS + 1
        ELSE
          SET UNITS = UNITS + 0.5;
      END;
    CLOSE FUNCTIONRESULT;
    RETURN UNITS;
    I've tried to follow the official MaxDB documentation.  My first deviation from that standard was the use of the "$COUNT" variable (instead of the "$RC" variable) immediately after the DECLARE/SELECT statement above.  When I tried to use $RC, for either a successful or unsuccessful query, $RC was always set to a non-zero value.
    I believe I'm past that, but now my issue is down around that FETCH statement.  The UNITS variable doesn't end up with the value I expect.  I know that it can be terribly confusing to try to analyze someone else's logic, but here's a brief narrative that describes what I'm trying to do...
    The GLAR_SOLDS table holds one line for each home sold.  It's keyed by the MLSnumber.  Each record also stores up to four agents who've been involved in the transaction: the listing agent, the co-listing agent, the selling agent, and the co-selling agent.  The database function I've written above pertains to the listing side only.  If I can get this to work, a separate function will process the selling side.  If no co-listing agent is involved in a given sell, that agent should get credit for 1 unit sold.  If he/she has help from a co-listing agent, the agent should only get credit for 1/2 unit sold.
    Also, does anyone know how the "Debug SQL" functionality is supposed to work within Database Studio?  When I right-mouse click on my function, and follow the path thru "Debug As...", after entering the connection & function arguments, I'm presented with an empty screen.  If you could point me to some documentation somewhere, I'd gratefully read it.
    I'm using MaxDB 7.7.06.09 on Windows XP (WIN32) with MaxDB Database Studio 7.7.06.09 (build 009-123-202-944).
    Thanks everyone for your help & advice.
    ~Fred

    Fred,
    please either provide the full SQL statements for your example or stick with mine.
    I'm not going to build it up myself a second time to suit yours now.
    >  But now, my issue is how do I store the resultant data in its own table?
    So where is the problem?
    INSERT INTO <target table> (field 1, field 2, ...)  (<your query>)  UDPATE DUPLICATES-
    With my tables this looks like this:
    create table sell_result (list_agent varchar(20) primary key, SUM_CREDIT fixed (10,2))
    insert
    into sell_result (list_agent,sum_credit)
        ( select list_agent, sum (credit) as SUM_CREDIT
          from ( select sh.object_id,lag.name as list_agent, 1 as credit
                 from soldhomes sh join agents lag on lag.id = sh.list_agent_id
                union all
                 select sh.object_id, lag.name as list_coagent, 0.5 as credit
                 from soldhomes sh join agents lag on lag.id = sh.list_coagent_id
          group by list_agent
    update duplicates
    Check what we have now
    sqlcli db770=> select * from sell_result
    | LIST_AGENT           | SUM_CREDIT        |
    | -------------------- | ----------------- |
    | Lars                 |              4.50 |
    | Lisa                 |              3.00 |
    | Mona                 |              2.50 |
    | Paul                 |              2.50 |
    4 rows selected (600 usec)
    Now add some sales data...
    Insert into soldhomes values (11, 1, 2, NULL, NULL)
    Insert into soldhomes values (12, 2, NULL, NULL, NULL)
    Insert into soldhomes values (13, 2, NULL, NULL, NULL)
    Re-run the INSERT command and you're done:
    sqlcli db770=> select * from sell_result
    | LIST_AGENT           | SUM_CREDIT        |
    | -------------------- | ----------------- |
    | Lars                 |              5.50 |
    | Lisa                 |              3.00 |
    | Mona                 |              5.00 |
    | Paul                 |              2.50 |
    4 rows selected (390 usec)
    Neat, isn't it?

  • Urgent help need:How inventory system and fulfillment system work

    Hi Every one ,
    I have an requirement to work on inventory and fulfillment system,below are my questions,
    1)I have stock level quantity for an sku is 2 ,if one user done with his order with quantity of 2 then how we can show quantity to the second customer (if stock not available we gone loss the business )
    how we can handle this ?
    2)There are few orders are completed(if some are orders are having quantity available in stock some or backorders)
    here how the fulfillment system understand those orders and how it will update the inventory.
    Could you please any one help me how to work on above requirements or else give me some other solutions to full fill above .
    Regards,
    Jyothi Chidurala
    Edited by: Jyothi.mj on May 22, 2013 5:08 AM
    Edited by: Jyothi.mj on May 23, 2013 4:28 AM

    >
    1)I have stock level quantity for an sku is 2 ,if one user done with his order with quantity of 2 then how we can show quantity to the second customer (if stock not available we gone loss the business )
    how we can handle this ?
    you can always call InventoryManager.AVAILABILITY_STATUS_IN_STOCK to check whether the item is available in inventory , It is the business call if item not available how they want to handle this .
    hope this helps

  • How does the "Read TDMS" function work when reading part of a data file?

    Hi everyone,
    I have stored some rather large .lvm files that causing me a a big headache when trying to read/analyse the data.... As a work around I first convereted these files to .tdms.... Now the files are much smaller (50%) and can be load/plot within a couple of seconds rather than 10's of seconds.
    Specifically, the files include 7 channels of data that were sampled at 2kHz for about 8-9 mins..... So, each file contains about 700,000 data points or elements.... I am using a producer/consumer architechure to read/plot all the data, then using cursors to identify a data subset, which is send via a queue to the consumer where analysis occurs.... Given the size of the files, when subset is quite large I get "Out of Memory" errors and LabVIEW crashes.
    What I am thinking is that I can down-sample or decimate the data in the producer back to 1kHz (I need to ms resolution so I can see the spikes and can appropriately selected the subset) then index back into the original tdms file to send the undeciated data to the consumer.
    With the "Read TDMS" function, the help states:
    COUNT: Specifies the maximum number of data elements to read from the .tdms file for each channel. The default is –1.
    OFFSET: Specifies the number of data elements into the .tdms file at which the function begins analyzing the .tdms file. The default is 0.
    I am confused by the term "elements". Does this mean actual "data points" as in elements within the 2D array? Or bytes? I am hoping array elements... Would this then mean that given my 7 channels of data, each element value that is a multiple of 7 would index into a new line of data? I also assume this index is zero based... So with no offset, a count value of 0 would return all the data elements at time 0.0000s for all channels (regardless differences in the precision of each channel, unlike bytes), a value of 7 would return all the data elements at time 0.0005s, a value of 14 would return all the data elements at time 0.0010s, etc etc..
    Also, if anyone has any example code for indexing into a file using this method they could shareI would be very appreciative... I would assume a for loop could also be used to read the data subset into the consumer in smaller chunks to reduce the memory load?
    Many thanks,
    Jack

    You should have a different channel in the TDMS file.  So you are reading X elements from a channel starting at element Y.  Yes, those are elements in the array, not Bytes.  NI did a good job of making the API easy to use.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How does idx and sub files work?

    How can I get idx and sub files to work on quicktime and apple tv? I have a mp4 movie with those subtitle files and wonder how they work.
    Message was edited by: elangsru

    Go to ine.com and sign up for a free membership. They offer free streaming of the CCNA R/S and CCNA Voice videos. You can also use Google to find many resources to read on.

  • How are listbox and radiobutton items working in oracle forms?!?

    Hi all.
    I need some help over may be a standard case in every real project.
    Imagine i have a db table PERSONS -> PERSONID, NAME, TOWNID, MATRIALSTATUSID
    and table TOWNS -> TOWNID, TOWNNAME
    and table MATRIALSTATUS -> MATRIALSTATUSID, NAME
    And i have a standard oracle form with text item person name, listbox item with many towns (from TOWNS table) and the town of the concrete person is selected when the form is inited, after that we can change it by selecting other town and saving it to db.
    The same is with matrial status but lets make it as radio group with 3 buttons married, not merried, divorced.
    So my questions is how to populate the listbox(radiogroup) for 1 person by selecting data from other preferenced tables. And most important how this data is populated in the list box for example i.e. every town name is indexed in some way or what. I am a java developer and for example in java the control listbox item has two attributes the name(string) that is displayed in the listbox and a index binded for that name, and i work with indexes and show strings. I read about LOV but couldn't understand how to "index" the populated values. Is it possible.
    And please can you give me some example of how to load (populate + set current town), change and (if it is possible) "index". The same case appears to be valid with radio buttons and check boxes.
    You could give me some tutorials too, i cant find simple and focused on the problem examples.
    Thank you.
    Best Regards.

    Hi,
    well here is what i done for now.
    First I created recordGroup with query SELECT GENDER, GENDERID FROM GENDERS (I want to select all genders and place them in listbox)
    After that i created Listbox and on triger when-new-form i placed this code:
    DECLARE
    it ITEM:=FIND_ITEM('PERSONS_DETAILS.GENDER');
    BEGIN
    CLEAR_LIST(it);
    POPULATE_LIST(it, 'RG_LIST');
    DEFAULT_VALUE(NULL, 'GLOBAL.PERSONID');
    IF :GLOBAL.PERSONID IS NOT NULL THEN
    SET_BLOCK_PROPERTY('PERSONS_DETAILS', ONETIME_WHERE, 'PERSONID=' || :GLOBAL.PERSONID);
    GO_BLOCK('PERSONS_DETAILS');
    EXECUTE_QUERY;
    :GLOBAL.PERSONID:=NULL;
    END IF;
    END;
    Imagine i have a main form PERSONS that displays general information about many persons (the data is retrieved from PERSONS db table). The form PERSONS displays PERSONID, PERSON FIRSTNAME and PERSON LASTNAME. When a user double click on some row from the PERSONS FORM( i have tabular datablock that displays the person data) other form 'PERSONS_DETAILS' must be displayed with detailed information about the selected person. The data about the selected person is loaded well but i want gender to be listbox and the user can change it if he wants. So i have TABLE GENDERS 1:N with PERSONS and the table has GENDERID AND GENDER. When the user double clicks on single person i must populate the list with all possible genders from the GENDERS table and set the gender of the selected person. How to do that?
    P.S.: The example with gender is not very good because it could be only male female, but don't worry about it. You may think about gender list as townlist :)
    It finds me the GENDER LIST and populates it. After that i take the personId (that is global variable and comes from previous form) and displays all the data for the person with id personid.
    When i compile the form it gives me :
    FRM-30351: No list elements defined for list item.
    List GENDER
    Edited by: user9536806 on Nov 19, 2008 3:01 AM

Maybe you are looking for