10

I am trying to plot sales data on a map using QGIS. I will add the disclaimer that I am a rookie at using the program. I added the different sales types by adding delimited text layers (utf16). The data included Longitude, Latitude, and Amount. I want to make the dots on the map scale with the value of the sale. Ive had no luck with trying to use Simple Marker->Data defined properties-> size and writing case functions. Some data points show up at different sizes while others show up at all data points. Here are my functions under different simple markers:

CASE WHEN Amount <= 10000 THEN '.2' END
CASE WHEN 10000 < Amount < 75000 THEN '.4' END
CASE WHEN 75000 < Amount <= 250000 THEN '.6' END
CASE WHEN Amount >= 250000 THEN '1' END

The majority of my data set falls into the 10-75k range. However the .4 and .6 size circles show up at every data point on the map, while the .2 and 1 sizes only show up where the data specifies (along with the .4 and .6 sizes). At this point I am trying to figure out what is wrong with the equations, however I am stuck.

Is there a better way to go about this or am I just simply messing up the equations?

I wish I could share my whole map with you but it is looking great. I went with U/Joseph 's solution and here is an excerpt of the results for those interested.

enter image description here

0

3 Answers 3

11

The answer provided by @evv_gis should do what you want. An alternative, practically similar to the answer posted by @hexamon, is to use Rule-based styling instead of Interval (I use QGIS 2.2 and I also do not see this option so I'm guessing it's an alternative name in another QGIS version?). Personally, I prefer rules to values as you can add various conditions whereas values are set between 2 limits.

Style

Here you can set the size for each point based on the rules you set as above.

Rule properties

7
CASE 
WHEN "Amount" <= 10000 THEN .2 
WHEN "Amount" > 10000 AND  "Amount"  <= 75000 THEN .4
WHEN "Amount" > 75000 AND  "Amount"  <= 250000 THEN .6
WHEN "Amount" > 250000 THEN 1
END

It looks like you need to switch the bracket in you second and third case. You also had the same case for values of 250000 to be .6 and 1.

See below:

enter image description here

3
  • I adjusted them to as you have them shown and still have the same issues. Is it possible to have 4 different markers for 1 layer?
    – Jay
    Commented Sep 11, 2014 at 13:47
  • 1
    Please see my edited post. I tested and it works fine.
    – evv_gis
    Commented Sep 11, 2014 at 14:05
  • I will add the "and" to the formulas I didn't think to do that before. Will update when I get back to the office in a few hours. Thanks for the help!
    – Jay
    Commented Sep 11, 2014 at 14:12
2

If those are your four cases I would go into the Properties for that layer and under Style select Interval, set it to 4 classes, set the values to those you described, and then set the style manually for each class.

Not as elegant as connecting it directly to a data column, but I've never really gotten that to work well without creating a new column for that specific purpose (which is also a bit inelegant.)

Edit: It turns out the word is 'Graduated' rather than 'Interval.' I have a translated version of QGIS and made the wrong assumption about the translation.

2
  • Im not seeing the Interval setting under the Style tab. Imgur
    – Jay
    Commented Sep 11, 2014 at 13:56
  • If you click the drop down that says Single Symbol, you should be able to see Interval.
    – hexamon
    Commented Sep 11, 2014 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.