1 2 3 4 5 Previous Next 98 Replies Latest reply on Jan 12, 2015 7:34 AM by danny.lackey Go to original post
      • 30. Re: Need to create buffer around points.
        Richard Leeke

        The packaged workbook contains a copy of the Access database - that was what I meant about the Unpackage command. If you do that it will extract the *.twb file and also a folder called "WellsAndRigs_v8_1_Access 2.twb Files". Drill down in that folder and you'll find the D/B.

         

        (A packaged workbook is just a ZIP file with a different file extension, by the way, so the other way to get at it is just to open it with a ZIP tool.)

         

        By the way, the way I have done it does mean that a lot of the work is happening in Tableau. I think it should work OK with the sorts of numbers of rigs and wells you are talking about - as long as you filter down to just the work scheduled for a given day. Even displaying 360 points for all 600 odd entries (which comes to about 250,000 points) will probably work - but that might get a bit sluggish.

        • 31. Re: Need to create buffer around points.
          danny.lackey

          Thanks.  I never knew that - makes sense, though.  Just renamed the .twbx and extracted contents through windows default zip app.  Worked like you said.

           

          I'll give it a try.  Hopefully it's not too sluggish.  Going to move forward with the idea that Id can become Well.  May be an issue if this has to be unique.

          • 32. Re: Need to create buffer around points.
            Richard Leeke

            Post back when you succeed, too – always nice to know how these things turn out.

            • 33. Re: Need to create buffer around points.
              Richard Leeke

              Just noticed your comment about Well not being unique.

               

              I'm pretty sure you are going to need unique Ids - or at least unique for the set of rows returned by your date filter. Several of the calculations rely on that being a unique identifier, I think.

              • 34. Re: Need to create buffer around points.
                danny.lackey

                Ok.  It will be a unique row, but more than one rig may try to schedule work for that well on a given day, which is what we are trying to catch.  Do you think it's wise to keep the Id column as a unique number?  If so, how do you manage that?  Does the number itself matter?  Meaning, if I let it reassign new numbers for the whole data set with each refresh, does that impact the outcome?  Or must it keep the same number for the life of the record?

                • 35. Re: Need to create buffer around points.
                  danny.lackey

                  Hmmm...  I'm getting the query is too complex message.  I even tried wiping all records but two, same result.  As far as I can tell, I've got all of the necessary pieces in place...

                   

                  EDIT - ok, may have been something weird with the sheet I was working in.  Put into new sheet and is executing now...  2 min in so far...  May be sluggish like you mentioned...

                   

                  EDIT 2 - well, spoke too soon.  Eventually failed with query too complex.  I may be forced to calculate this in Access...  Aside from the number of columns and number of records, I'm not seeing what's different.

                  • 36. Re: Need to create buffer around points.
                    Richard Leeke

                    If you can post a packaged workbook with your real data structure (not your real data – though something vaguely representative would help) I’ll try to take a look sometime.

                     

                    It did occur to me when I was bodging my way past the query is too complex message that your real database might be different enough that that would come back.

                     

                    Worst case may be that you have to generate data extracts. With your data volumes that should only take a matter of seconds, would doing that manually whenever the database has been updated be workable for you?

                    • 37. Re: Need to create buffer around points.
                      danny.lackey

                      Yes, it's dummy data located in the db with same structure.  I dummied up the lat/lons too, just to be safe.  I changed them by the same amount, so in theory it seems like they should still be in relation to each other on the map?

                       

                      I just tried it using a data extract and it seems to be working.  Still testing.

                      • 38. Re: Need to create buffer around points.
                        Richard Leeke

                        Sorry, hadn't spotted that you had attached the workbook before - that's what comes of just using the email notifications from the forums from my phone - I don't think the forum sends out updates when you edit a post, so I had just seen your original message about the query is too complex message.

                         

                        I'll try to take a look over the weekend (Friday here now).

                        • 39. Re: Need to create buffer around points.
                          Richard Leeke

                          I took a bit of a look at the "query too complex" error. I compared your SQL with mine by looking in the Tableau logs and the only difference I could spot was that yours was slightly larger because some of your field names and table names are a little longer than mine. Yours was around 32 KB, mine was 28 KB, so I suspect it may simply be a limit on the number of characters in the query. I did have a quick play with trying to cut yours down, without success - but that would be a risky course anyway because you are bound to want to add more fields one day, so it could just break again.

                           

                          Looking at the generated query, there is a massive amount of bloat caused by the way that Tableau generates expressions to guard against things like dividing by zero. If you are feeling brave and really want to keep the workbook running off a live data connection the only safe ways I can see would be either to put a lot of the calculation logic into Access functions and create Access views which use those functions and return the results you want, or you could possibly write simplified versions of the Tableau calculations eliminating any unnecessary checks for divide by zero (you may be able to tell from the data where those are not needed) using RAW_SQL expressions.

                           

                          That all seems like a very hard road compared with running off extracts. Extracts will also be faster - though it does need a couple of minutes to refresh the extracts.

                           

                          I've pasted in the SQL for the circles query at the bottom of this post, if you want to convince yourself it's a bad idea to try to simplify it.

                           

                          I was also interested to see how the approach I used would work with your data, so I hooked up your database to my workbook and generated extracts for both datasources. Having done that I took out all the bodges I had put in to make the calculations happen in Tableau - it's much better to let the data engine do those and it makes the expressions simpler.

                           

                          There was a bit of tweaking needed to make it work with [WELL] exposed but using the unique [Id] for each job. I also played around a bit with the actions linking the sheets on the dashboard (you can now highlight or filter) and I turned off labels unless the centres are selected. (Oh and I had to switch to American spelling of centre.)

                           

                          I also generated a time parameter and added a time range parameter so that you can filter on jobs within a few days of each other. That had the effect of making it appear that jobs scheduled for the same well but close together in time might be in conflict. I have no idea how much variability you have in your scheduling, so I don't know if that would be a real issue, but I left it flagging those. I think it would probably be better if you had start and end dates (or start date and duration) in your data source, if that is available.

                           

                          Anyway - I've spent far longer than I intended to on this, but it was a fun little challenge. Here's where I got to (also attached in 8.1 format, I'm not sure if Tableau Public upgrades it to 8.2).

                           

                           

                          Here's the SQL that JET was complaining was too complex. I do see it what it means.

                           

                          SELECT IIF(([Circle].[Type] = 'Center'),((([CM_DATA].[TEAM] + ' (') + IIF(IsNull([CM_DATA].[WELL]),NULL,CStr([CM_DATA].[WELL]))) + ')'),IIF(1=0,NULL,NULL)) AS [none:Calculation_0630923160218234:nk],

                            IIF(([Circle].[Type] = 'Center'),[CM_DATA].[LAT],(IIF(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))<>1,ATN(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))/SQR(1-((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45))))))),IIF(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))=1,((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))*2*ATN(1),NULL)) * 45 / ATN(1))) AS [none:Calculation_4380923212813652:ok],

                            [Circle].[Degree] AS [none:Degree:ok],

                            [Circle].[ID] AS [none:ID:ok],

                            [CM_DATA].[Id] AS [none:Id:o1],

                            [CM_DATA].[TEAM] AS [none:TEAM:nk],

                            [Circle].[Type] AS [none:Type:nk],

                            MIN(IIF(([Circle].[Type] = 'Center'),[CM_DATA].[LAT],(IIF(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))<>1,ATN(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))/SQR(1-((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45))))))),IIF(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))=1,((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))*2*ATN(1),NULL)) * 45 / ATN(1)))) AS [TEMP(Calculation_4030923212946609)(1590544389)(0)],

                            MAX(IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree])))) AS [TEMP(Calculation_4030923212946609)(1591687106)(0)],

                            MIN(IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER])))) AS [TEMP(Calculation_4030923212946609)(2309268660)(0)],

                            MAX(IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER])))) AS [TEMP(Calculation_4030923212946609)(2824205404)(0)],

                            MIN([CM_DATA].[LAT]) AS [TEMP(Calculation_4030923212946609)(3083326958)(0)],

                            MAX(IIF(([Circle].[Type] = 'Center'),[CM_DATA].[LAT],(IIF(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))<>1,ATN(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))/SQR(1-((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45))))))),IIF(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))=1,((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, IIF(IsNull([CM_DATA].[BUFFER]),NULL,SGN([CM_DATA].[BUFFER])*Int(ABS([CM_DATA].[BUFFER]))) / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)),NULL,COS((IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree]))) * ATN(1) / 45)))))*2*ATN(1),NULL)) * 45 / ATN(1)))) AS [TEMP(Calculation_4030923212946609)(3170349389)(0)],

                            MIN([CM_DATA].[LON]) AS [TEMP(Calculation_4030923212946609)(3301834576)(0)],

                            MAX([CM_DATA].[LAT]) AS [TEMP(Calculation_4030923212946609)(353734687)(0)],

                            MAX([CM_DATA].[LON]) AS [TEMP(Calculation_4030923212946609)(3929964106)(0)],

                            MIN(IIF(IsNull([Circle].[Degree]),NULL,SGN([Circle].[Degree])*Int(ABS([Circle].[Degree])))) AS [TEMP(Calculation_4030923212946609)(482134169)(0)]

                          FROM [CM_DATA]

                            INNER JOIN [Circle] ON [CM_DATA].[JOIN_KEY] = [Circle].[JOIN_KEY]

                          GROUP BY IIF(([Circle].[Type] = 'Center'),((([CM_DATA].[TEAM] + ' (') + IIF(IsNull([CM_DATA].[WELL]),NULL,CStr([CM_DATA].[WELL]))) + ')'),IIF(1=0,NULL,NULL)),

                            IIF(([Circle].[Type] = 'Center'),[CM_DATA].[LAT],(IIF(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))<>1,ATN(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))/SQR(1-((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45))))))),IIF(((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))*((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))=1,((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,SIN(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,COS(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) + ((IIF(IsNull(([CM_DATA].[LAT] * ATN(1) / 45)),NULL,COS(([CM_DATA].[LAT] * ATN(1) / 45))) * IIF(IsNull(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))),NULL,SIN(IIF((5280 * Val(3958.7559999999999)) = 0, NULL, [CM_DATA].[BUFFER] / (5280 * Val(3958.7559999999999)))))) * IIF(IsNull(([Circle].[Degree] * ATN(1) / 45)),NULL,COS(([Circle].[Degree] * ATN(1) / 45)))))*2*ATN(1),NULL)) * 45 / ATN(1))),

                            [Circle].[Degree],

                            [Circle].[ID],

                            [CM_DATA].[Id],

                            [CM_DATA].[TEAM],

                            [Circle].[Type]

                          1 of 1 people found this helpful
                          • 40. Re: Need to create buffer around points.
                            danny.lackey

                            How did you get your circles to look like a solid line?  Mine are a series of dots even though I have "Line" selected.  I'll have to agree with Tableau - too complex.  haha

                             

                            EDIT - Dropped it on PATH and it started working.

                            • 41. Re: Need to create buffer around points.
                              danny.lackey

                              I appreciate the help.  I've been building on the last version and I'm finding it to be just fine for what I'm doing (via extract).  I did learn that they don't want a comparison within teams, only against other teams...

                              • 42. Re: Need to create buffer around points.
                                Richard Leeke

                                The cross-team comparison just means that the data source for the conflicts view needs to join the two instances of the table on the condition that team from the first instance doesn't equal team from the second instance.

                                 

                                Lines instead of dots: you just need to make the field on the path shelf an attribute rather than a dimension, I think. I recall noticing that as I reworked it.

                                 

                                 

                                Sent from my phone - excuse the weird typos.

                                • 43. Re: Need to create buffer around points.
                                  danny.lackey

                                  Prior to reading this, I tried this...  I viewed the "Self" field you created and tried to use similar logic.

                                   

                                  Example:  Self_Team:    [TEAM] == [CM_DATA1_TEAM]

                                   

                                  Then added to filters and set to false.  Seems to be working.

                                  • 44. Re: Need to create buffer around points.
                                    danny.lackey

                                    New issue I'm facing with the "Conflict Table" is getting the conflict matches right using dates.  I now have an end date in the mix and need to find conflicts that have intersecting dates (including the already established criteria).  The highlighted dates are dates that SHOULD show up, so that's good - but they are showing up regardless of date.  I'll explain the criteria I need using the highlighted dates - for pair 2686/2747, the end date of the first job (crew 2) falls within the start and end work range of crew 1, so this is a valid conflict.  Or conversely, the start date for crew 1 of 2686/2747 falls within the work range of crew 2.  For the non highlighted items - their dates never intersect, so they should not show up on this list.  Thinking I may need to do a similar comparison of start date in table1 vs start and end date of duplicate table 2. So far fail! DateIssue.jpg

                                    1 2 3 4 5 Previous Next