2 Replies Latest reply: Feb 28, 2012 5:30 AM by Jason Michaelides RSS

    Help selecting data

      Hi everyone,


      I need some help on the best way of selecting data. We are currently showing houses by price but would like to be able to select certain ranges E.g. 0-100k, 101-150k etc. What would be the best way to go about this?


      I have tried putting together a slider (using Discrete values seems to select a range) but the data in the graph it is selecting doesn't seem to be correct and in the 'Current Selections' box it only says 'House price' values '60 of 100' which isn't very useful for a user rather than saying the range they have selected. This may not be the best way so i'm definitely open to suggestions!


      Please help!!




        • Re: Help selecting data
          Miguel Angel Baeyens de Arce

          Hi Louise,


          Depending on your data model, assuming you don't have already the classification in your script, you can create two variables and use them in the slider object, say vRangeFrom and vRangeTo. Then use both values in the expressions of the charts, so for example, in a new pivot table with PropertyID as dimension, and the following as expression:


          Sum({< Price = {'>=$(vRangeFrom)<=$(vRangeTo)'} >} Price)


          Will show all those PropertyID value where the price is in the given range.


          Another (likely faster) option is to create the field in the script, using a conditional:


          LOAD *,
               If(Price < 150000, '<150K', 
                 If(Price < 250000, '<250K',
                   '>250K')) AS PriceClassification
          FROM File.qvd (qvd);


          Hope that helps.



          • Re: Help selecting data
            Jason Michaelides



            Try the attached.


            Hope it helps,




            EDIT:  Instead of my IF statement in the dimension, Miguel's set analysis would probably be more efficient

            Sum({< Price = {'>=$(vRangeFrom)<=$(vRangeTo)'} >} Price)


            Message was edited by: Jason Michaelides