Text Tables: Statistics For a Non Key Field

Within the LITHOLOGY table, there is a field .Stratum where each row in LITHOLOGY can be assigned a .Stratum integer 1-9. Suppose they are not necessarily in depth order (interlayered) and several LITHOLOGY rows within a POINT might be assigned the same stratum number.

I want to create a text table that contains rows .Stratum 1 through 9 and then in columns evaluations of the project data by stratum (rather than by boring). Column headers such as "Stratum ID", "min. depth stratum was encountered", "list of graphics used in this stratum", etc. However, .Stratum is not a set key by which I can dictate the table. How should I make the data expressions so that the table filters and outputs the way I want?

ie. For key set PointID, Header Text "Stratum ID", I want to output a row for each stratum encountered in the project.

Thanks,

Parents
  • Ok, I explored 3 options to incorporate boring selection into the output statistics. The first 2 didn't work but the third does. It is similar to the text document solution above but I will describe fully below:

    The example uses data in a LITHOLOGY table that includes depth, bottom and Strat_ID fields (among others).  The test data is shown in the picture below. It can be used to manually check the accuracy of the solution.

    I created a text document report with Key set PointID (note this is different than the previous solution above). Using Point ID key set gives me access to the standard gint boring selection pick list and all filters at output time. The following Code was placed in the text document report.

    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,"""Summary for borings <<OutputKeys>>""")>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,"Stratum,Min Top Depth,Max Top Depth,Min Thickness,Max Thickness,No. of Occurences")>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,_
    "Stratum 1,_
      <<Sql(Select min([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "1" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "1" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select min([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "1" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "1" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select Count([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "1" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>"_
    )>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,_
    "Stratum 2,_
      <<Sql(Select min([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "2" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "2" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select min([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "2" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "2" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select Count([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "2" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>"_
    )>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,_
    "Stratum 3,_
      <<Sql(Select min([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "3" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "3" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select min([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "3" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "3" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select Count([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "3" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>"_
    )>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,_
    "Stratum 4,_
      <<Sql(Select min([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "4" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "4" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select min([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "4" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "4" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select Count([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "4" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>"_
    )>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,_
    "Stratum 5,_
      <<Sql(Select min([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "5" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "5" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select min([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "5" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "5" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select Count([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "5" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>"_
    )>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,_
    "Stratum 6,_
      <<Sql(Select min([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "6" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "6" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select min([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "6" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "6" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select Count([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "6" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>"_
    )>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,_
    "Stratum 7,_
      <<Sql(Select min([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "7" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "7" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select min([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "7" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "7" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select Count([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "7" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>"_
    )>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,_
    "Stratum 8,_
      <<Sql(Select min([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "8" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "8" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select min([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "8" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "8" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select Count([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "8" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>"_
    )>>
    <<IIf(<<POINT.PointID>>=<<GetListItem(<<OutputKeys>>,", ",1)>>,_
    "Stratum 9,_
      <<Sql(Select min([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "9" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "9" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select min([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "9" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select max([LITHOLOGY].[Bottom]-[LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "9" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>,_
      <<Sql(Select Count([LITHOLOGY].[Depth]) FROM [LITHOLOGY] WHERE [LITHOLOGY].[Strata_ID] = "9" AND [LITHOLOGY].[PointID] IN (<<OutputKeysInClause>>))>>"_
    )>>

    Notes on this code:

    A. Line 1-the triple quotes are required to generate a quoted text string that includes all the borings.  This forces it to import into a single cell in excel rater than one cell for each boring and serves as a title for the summary table.

    B. Line 1- the if statement compares the current Point to the first point in the output list and only prints something if it is the first one in the list. All other points generate nothing which eliminates the repetitive data. Note that the delimiter in the <<OutputKeys>> data item is a comma followed by a space.  This same if statement is used for all the rest of the outputs on this page. Thus it only generates data for the first selected point.

    C. Line 2- This prints titles for each column in the table. Quotes are required here or gINT will interpret the commas as additional arguments in the if statement.

    D. Line 3-10 - The if statement only prints this line of data if the PointID is the first item in the output list. Quotes are required around the True clause of the if to prevent gINT from interpreting the comma delimiters as argument separators. This same format is repeated for each stratum ID 1 through 9.

    E. Line 5-9 - The sql statements include an AND clause that further restricts the output to the selected borings as represented by the data item <<OutputKeysInClause>>

    F. Line 11 to end - Each block repeats lines 3-10 but increments the strata_ID by 1.  You could probably do this more efficiently using an iterate function which I tried to do.  I had trouble getting the quotes in the right places so resorted to the brute force method. Note that the strata_ID number in my data base is a text data type rather than a number so I had to quote the number in the sql statement.

    Previewing this output on the screen and leaving the boring selection blank selects all borings in the project and produces the following:

    The is the same result as obtained previously using the text document with a project keyset (see answer above). Exporting this to a text file from gINT and opening in excel gives the following summary.

    Importing into excel is as simple as Starting excel, selecting file open, selecting text file type in the file dialog, selecting your exported file, selecting delimited in the import wizard, selecting comma as a delimiter and there it is. No post processing required. I suppose you could modify the code to use tab delimiters which would eliminate one step in the import process but I did not try that.

    Reexporting selecting only 4 borings in the output screen and reimporting into excel gives the following output.

    This can be checked manually using the data sample provided at the beginning of this post thus it seems to work fine. It should work the same if borings were selected using gINT's output filters as well but I haven't tried that.

    As usual I have not tested this fully with lots of different data so I may be missing something.  There are probably better ways to do this but this is one way. You can add additional sql statements to each strata block to extract additional data as desired, just make sure they are separated by a comma delimiter and and are within the quotes of the iff function. In my example you have to add the statements repetitively to each of the 9 blocks (if you can figure out the iterate function this would make changes easier).

    Answer Verified By: Jason Varounis 

  • szang,

    Thanks for all your help trying to figure this out. I played with few other ideas over the weekend but none of them worked. I guess your text document output is the best answer. This allows the user to select borings for data output, but it requires two exports; one to text and then to excel. While not perfect, I agree this is the most user-friendly solution so far. I think I am going to take this and run with it.

    Bentley hivemind, any other ideas?

  • Here is the final product. Text Document Report with keyset PointID. Verified it works by exporting to .txt then changing extension to .csv and opening in Excel.

    <<IIf(<<POINT.PointID>> = <<GetListItem(<<OutputKeys>>,", ",1)>>,"""Borings Selected: <<OutputKeys>>""")>>
    <<IIf(<<POINT.PointID>> = <<GetListItem(<<OutputKeys>>,", ",1)>>,"Stratum,Encountered in Borings,Graphics Used,USCS Used,AASHTO Used,Min. Top Depth,Max. Bottom Depth,Max.Top EL,Min. Bottom EL,SPT N Min.,SPT N Max.,SPT N Avg.,NMC Min.,NMC Max.,NMC Avg.,LL Min.,LL Max.,LL Avg.,PL Min.,PL Max.,PL Avg.")>>
    <<iterate(StratumRow,1,9,,<<cr>>,<<IIf(<<POINT.PointID>> = <<GetListItem(<<OutputKeys>>,", ",1)>>,_
        "<<Get(StratumRow)>>,_
        ""<<SQLList(,Select Distinct [LITHOLOGY].[PointID] From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>"",_
        "<<SQLList(,Select Distinct [LITHOLOGY].[Graphic] From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>",_
        "<<SQLList(,Select Distinct [LITHOLOGY].[USCS] From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>",_
        "<<SQLList(,Select Distinct [LITHOLOGY].[AASHTO] From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>",_
        <<SQL(Select Min([LITHOLOGY].[Depth]) From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([LITHOLOGY].[Bottom]) From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([POINT].[Elevation] - [LITHOLOGY].[Depth]) From [LITHOLOGY] Inner Join [POINT] On [LITHOLOGY].[PointID] = [POINT].[PointID] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min([POINT].[Elevation] - [LITHOLOGY].[Bottom]) From [LITHOLOGY] Inner Join [POINT] On [LITHOLOGY].[PointID] = [POINT].[PointID] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min(IIf(IsNumeric([SAMPLE].[SPTN Override]),[SAMPLE].[SPTN Override],[SAMPLE].[SPTN Calculated])) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max(IIf(IsNumeric([SAMPLE].[SPTN Override]),[SAMPLE].[SPTN Override],[SAMPLE].[SPTN Calculated])) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Avg(IIf(IsNumeric([SAMPLE].[SPTN Override]),[SAMPLE].[SPTN Override],[SAMPLE].[SPTN Calculated])) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min([SAMPLE].[NMC]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([SAMPLE].[NMC]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Avg([SAMPLE].[NMC]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min([SAMPLE].[LL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([SAMPLE].[LL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Avg([SAMPLE].[LL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min([SAMPLE].[PL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([SAMPLE].[PL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Avg([SAMPLE].[PL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>"_
    )>>)>>

Reply
  • Here is the final product. Text Document Report with keyset PointID. Verified it works by exporting to .txt then changing extension to .csv and opening in Excel.

    <<IIf(<<POINT.PointID>> = <<GetListItem(<<OutputKeys>>,", ",1)>>,"""Borings Selected: <<OutputKeys>>""")>>
    <<IIf(<<POINT.PointID>> = <<GetListItem(<<OutputKeys>>,", ",1)>>,"Stratum,Encountered in Borings,Graphics Used,USCS Used,AASHTO Used,Min. Top Depth,Max. Bottom Depth,Max.Top EL,Min. Bottom EL,SPT N Min.,SPT N Max.,SPT N Avg.,NMC Min.,NMC Max.,NMC Avg.,LL Min.,LL Max.,LL Avg.,PL Min.,PL Max.,PL Avg.")>>
    <<iterate(StratumRow,1,9,,<<cr>>,<<IIf(<<POINT.PointID>> = <<GetListItem(<<OutputKeys>>,", ",1)>>,_
        "<<Get(StratumRow)>>,_
        ""<<SQLList(,Select Distinct [LITHOLOGY].[PointID] From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>"",_
        "<<SQLList(,Select Distinct [LITHOLOGY].[Graphic] From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>",_
        "<<SQLList(,Select Distinct [LITHOLOGY].[USCS] From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>",_
        "<<SQLList(,Select Distinct [LITHOLOGY].[AASHTO] From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>",_
        <<SQL(Select Min([LITHOLOGY].[Depth]) From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([LITHOLOGY].[Bottom]) From [LITHOLOGY] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([POINT].[Elevation] - [LITHOLOGY].[Depth]) From [LITHOLOGY] Inner Join [POINT] On [LITHOLOGY].[PointID] = [POINT].[PointID] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min([POINT].[Elevation] - [LITHOLOGY].[Bottom]) From [LITHOLOGY] Inner Join [POINT] On [LITHOLOGY].[PointID] = [POINT].[PointID] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min(IIf(IsNumeric([SAMPLE].[SPTN Override]),[SAMPLE].[SPTN Override],[SAMPLE].[SPTN Calculated])) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max(IIf(IsNumeric([SAMPLE].[SPTN Override]),[SAMPLE].[SPTN Override],[SAMPLE].[SPTN Calculated])) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Avg(IIf(IsNumeric([SAMPLE].[SPTN Override]),[SAMPLE].[SPTN Override],[SAMPLE].[SPTN Calculated])) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min([SAMPLE].[NMC]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([SAMPLE].[NMC]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Avg([SAMPLE].[NMC]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min([SAMPLE].[LL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([SAMPLE].[LL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Avg([SAMPLE].[LL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Min([SAMPLE].[PL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Max([SAMPLE].[PL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>,_
        <<SQL(Select Avg([SAMPLE].[PL]) From [SAMPLE] Inner Join [LITHOLOGY] On ([SAMPLE].[Depth] + ([SAMPLE].[Length] / 6)) Between [LITHOLOGY].[Depth] And [LITHOLOGY].[Bottom] Where [LITHOLOGY].[Stratum] = <<Get(StratumRow)>> And [LITHOLOGY].[PointID] In (<<OutputKeysInClause>>))>>"_
    )>>)>>

Children
No Data