Using Flag SQL in GEOVIA Minex to Constrain Sample Data

As a GEOVIA Minex user, you may have constrained sample or seam data while plotting, reporting or conducting statistical analysis. Such constraining may have included:

  • Negative Interburden
  • Depth > 200
  • Thickness < 1.00m
  • Bad ASH > 20
  • CV >

With thousands of holes and hundreds of seams, filtering the data is often time-consuming.

Minex has a simple and elegant solution for this and that is to use FLAG SQL. Flag SQL is a simple script written in notepad and saved with the ‘.sql ‘ extension as shown below. You can copy and change variables from the text below.

FLAG SQL Script:


! Description: This macro to find seam thickness greater than 2 m

!! Variable definitions:


! Setup conditions:



    AND SEAMTH > 5


  FLAG 1


  FLAG 0


How can I use Flag SQL?

You can use it for seam reporting, during borehole plan locations and during statistical analysis and cross-correlation.

Once you have saved the above SQL script, you can proceed to follow one of the following steps.

For seam reporting:

Select the appropriate variables and checkboxes under Parameters.

Check the Use SQL File box and select the FLAG SQL script you just saved.

Click OK. The seam report should honor the condition written in the script and constrain the data.


For borehole plan locations:

Under the Seam List tab (not pictured below), select your seam and variable.

Under the Plotting Params tab, check the appropriate boxes. Under Borehole Filtering, be sure to check the box Only plot holes with data.

Under SQL File, select the FLAG SQL script you saved earlier to plot the borehole with condition.

For Statistical Analysis and Cross-Correlation:

You can check the Use SQL File box and select your file, as shown below in the Statistics & Histogram screen and Cross Correlation screen.


For more Minex tips, visit:

Ajay Reddy

Ajay Reddy

Senior Industry Process Consultant, Mining at Dassault Systèmes
Ajay Reddy is a qualified Geologist with over 24 years of experience in coal exploration, mining and resources estimation. He has previously worked for one of the largest Indian coal exploration and mining companies, Singareni Collieries, and TATA Steel. Based in Brisbane, Australia, Ajay specializes in GEOVIA Minex and Surpac.