<div dir="ltr"><div style="font-size:12.8px">Thank you, Tyler.</div><div style="font-size:12.8px">my table was built with the sampling dates wells, however, every time the sampling was done ... was created a line with the same coordinate to update the sampling.</div><div style="font-size:12.8px">I believe so is being very difficult to establish a filter.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Bia;</div><div style="font-size:12.8px"><span style="font-size:12.8px">Not sure though how that would effect filtering, one of those things where I would need to see the data and try some expressions.</span><br></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px">I would almost break the table up into 2 tables; Sampling Dates and Well Points. Then use a relationship between the 2 tables (well_id pk in wells and a well_id fk in samples). That should make the data simpler, and perhaps provide a better ability to organise and filter.</div><div style="font-size:12.8px">Tyler</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 14, 2016 at 11:49 AM, Tyler Veinot <span dir="ltr"><<a href="mailto:tylerkveinot@gmail.com" target="_blank">tylerkveinot@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Bia;<div>Sorry for the duplication but I am trying to keep my responses on the list. Unfortunately I often hit reply and not rely all:</div><span class=""><div><br></div><div><span style="font-size:12.8px">Bia;</span><div style="font-size:12.8px">In 2.16.2 you can right click the column header and choose sort, this will bring up an expression builder. In there just add the field you want to sort by "Field_Name" or you can get fancy and say you want to sort by a number and a string field. Then you would do something like this "String_Field"||right(  ('00000000' || "Numeric_Field"), 8) Notice the "00000000" being added, that is because the expression treats the number like a string. Padding it with zeros sorts allows it to sort in order 1,2,3,4 if you do not pad you will end up with. 1,10,11,12,etc...<br>Dual sorting with date is a bit tricky but you can store the data as a YYYY,MM,DD type and it should sort for you. If your date is stored in another way, i.e. DD/MM/YYYY then you will have to format it to YYYY,MM,DD for proper sorting, i.e. Year("Date")||Month("Date")||D<wbr>ay("Date") should work to that effect. </div><div style="font-size:12.8px">As for sorting one column Ascending and another Descending I am at a loss, have not been able to figure that one out but someone here might add to my answer if you need to do that.</div><div style="font-size:12.8px">Additionally if your using an older version of QGIS that does not have the "sort" function you could write the expression to a virtual field and then sort it by clicking the column header of the new virtual field.</div><div style="font-size:12.8px">Hope that helps.</div><div style="font-size:12.8px">Tyler</div></div></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 14, 2016 at 11:26 AM, Bia <span dir="ltr"><<a href="mailto:bia.fs2000@gmail.com" target="_blank">bia.fs2000@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thank you, Tyler.</div><div>my table was built with the sampling dates wells, however, every time the sampling was done ... was created a line with the same coordinate to update the sampling.</div><div>I believe so is being very difficult to establish a filter.</div></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">2016-09-14 10:55 GMT-03:00 Tyler Veinot <span dir="ltr"><<a href="mailto:tylerkveinot@gmail.com" target="_blank">tylerkveinot@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Bia;<div>In 2.16.2 you can right click the column header and choose sort, this will bring up an expression builder. In there just add the field you want to sort by "Field_Name" or you can get fancy and say you want to sort by a number and a string field. Then you would do something like this "String_Field"||right(  ('00000000' || "Numeric_Field"), 8) Notice the "00000000" being added, that is because the expression treats the number like a string. Padding it with zeros sorts allows it to sort in order 1,2,3,4 if you do not pad you will end up with. 1,10,11,12,etc...<br>Dual sorting with date is a bit tricky but you can store the data as a YYYY,MM,DD type and it should sort for you. If your date is stored in another way, i.e. DD/MM/YYYY then you will have to format it to YYYY,MM,DD for proper sorting, i.e. Year("Date")||Month("Date")||D<wbr>ay("Date") should work to that effect. </div><div>As for sorting one column Ascending and another Descending I am at a loss, have not been able to figure that one out but someone here might add to my answer if you need to do that.</div><div>Additionally if your using an older version of QGIS that does not have the "sort" function you could write the expression to a virtual field and then sort it by clicking the column header of the new virtual field.</div><div>Hope that helps.</div><div>Tyler</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 14, 2016 at 7:38 AM, Bia <span dir="ltr"><<a href="mailto:bia.fs2000@gmail.com" target="_blank">bia.fs2000@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi, how can I to organize my table considering the date? I tried a expression but did not work. <br>
And after I wanna compare other columns to have a precision table. </p>
<p dir="ltr">Thank you! </p>
<br>______________________________<wbr>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman<wbr>/listinfo/qgis-user</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman<wbr>/listinfo/qgis-user</a><br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div data-smartmail="gmail_signature">Bea<br></div>
</font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>