TEXT 46
QGIS label every X item By mike on 28th March 2021 03:45:10 PM
  1. Example
  2. ==========
  3. CASE WHEN      $id%3    =0 THEN    'KP '||   format_number(  "KP" ,0)    END
  4.  
  5.  
  6. Source
  7. ==========
  8. https://gis.stackexchange.com/questions/133875/how-to-label-values-every-5th-number
  9.  
  10.  
  11. TXT
  12. ==========
  13. Q:
  14. I have a string of values (over 10,000) I want to label them but I don't want to label every single one. I need to label every fifth number.
  15.  
  16. A:
  17. Using QGIS 2.0.1, you can use an expression directly in the labelling tab in order to get what you need :
  18.  
  19. CASE WHEN      $id%5    =0 THEN    "yourfield"    END
  20. in other words, if your id value ($id is built in) is divided by 5, then label with the value in "yourfield"

Hasta la pasta! is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.