Ben Langhinrichs
Genii Weblog
Free Midas software plus a contest
Wed 2 Jun 2010, 01:43 PM
Copyright © 2010 Genii Software Ltd.
What has been said:
924.1. Jerry Carter (06/02/2010 08:21 PM)
Congratulations on your release, Ben. The 'free sample' is a time honored institution of capitalism. :-) May it reap the intended benefits for you and the community.
924.2. Richard Schwartz (06/02/2010 08:33 PM)
Does the key matching assume the the KeyColumn(+chunk) is a sorted list of values?
924.3. Ben Langhinrichs (06/02/2010 09:01 PM)
Jerry - Thanks!
Richard - By default it does not, since ad hoc data is so often... ad hoc, and since any one table can have at most 255 rows. There may be a property setting which can turn the aware of sorting back on. Let me know if you want that, as the engine certainly supports it.
924.4. Richard Schwartz (06/02/2010 09:36 PM)
Actually, I think it is preferable that it does not assume sorting, so don't add a property setting on my account!
Next question: since it does not assume sorting, am I correct in assuming that multiple matches will be found, even if separated by non-matching rows?
924.5. Ben Langhinrichs (06/02/2010 10:06 PM)
That is correct. It returns a value from each row that matches. For example, in the Currency fluctuation table from the sample db, you have two tables with dates in the format mm/dd/yyyy in the first column, and a conversion rate between US dollars and the Euro in the second column. If you want to get the average rate for the 13th of each month (06/13/2009, 07/13/2009 all the way to 05/13/2010), you would use the following formula (two @DbLookups because there are two tables):
rates := @DbLookup("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"Inside Table 1; Table 1"; "/13/"; 2; "Format=Number KeyMatch=SUBSTR"):@DbLookup("Midas":"NoCache"; ""; @DocumentUniqueID; "Body":"Inside Table 1; Table 2"; "/13/"; 2; "Format=Number KeyMatch=SUBSTR");
avg := @Sum(rates)/@Elements(rates);
924.6. Ulrich Krause (03.06.2010 05:02)
Hint: the sample database is encrypted ...
924.7. Ben Langhinrichs (06/03/2010 12:47 PM)
Sorry about the encryption. I had a small problem, fixed it and accidentally put up the encrypted version. Will fix in about half an hour.
924.8. Ben Langhinrichs (06/03/2010 02:27 PM)
Should be fixed now.
924.9. Ulrich Krause (04.06.2010 05:35)
How do I get a list of valid "chunkdefs"? Table or Bullet are in the sample. What about others?
924.10. Ben Langhinrichs (06/04/2010 02:13 PM)
@Ulrich - Good question. I will write this up in a separate blog post as well. Since the @Midas Lookups toolkit is built on the Midas Rich Text engine, the chunk definitions are the same as for the Midas Rich Text LSX. Thus, take a look at Working with chunk definitions for a complete explanation of the chunk logic.
One slight difference is that a chunk such as "Paragraph *" is dealt with all at once in the LSX, but the end wildcard in @Midas Lookups is replaced by 1, then 2, then 3, etc. Thus, if you defined a chunk as "Paragraph *" in the Midas Rich Text LSX and checked the Text property, it would give the first text chunk, but if you did a @DbColumn, it would get the first text in each paragraph as a list.
Have your say:

