6 Replies Latest reply: May 10, 2013 5:38 AM by stevewood RSS

    Set Analysis

      This should be an easy one for most people.....

       

       

      I am trying to sum the hits for a distinct date, dayused is in the format DD/MM/YYYY 00:00:00

       

       

      sum

      ({$<DISTINCT dayused>}hits)

       

      This is not however working? Any suggestions? Do I have the DISTINCT in the wrong place?

       

      Thanks

        • Re: Set Analysis
          Jonathan Brough

          hi steve,

          if dayused is a dimension in your chart, or if you are selecting dayused in a filter, then you shouln't need set analysis, just a sum of the hits.

          if dayused is a variable and you are trying to show the hits for the variable's date you will the following syntax>

           

          sum ({$<DayUserDateField={'$(dayused)'}>} hits)

           

          jonathan

            • Re: Set Analysis

              dayused is a dimension, so I simply created an expression of sum(hits), however, the results come out as per below;

               

              The problem I have is that there are a number of hits by various people, for example,

               

              uuid           dayused                         hits               addr_formatted               sum(hits)

              496833          02/04/2013                    1                    Steve Wood                    1

              496833          02/04/2013                    7                    John Wood                      7

              496833          02/04/2013                    8                    Sandra Wood                  8

               

              so it is not giving me the hits per day but instead summing the hits per addr_formatted.

               

              Steve

                • Re: Set Analysis

                  Actually when I remove the addr_formatted field as a dimension it sums the hits by physical number

                   

                  so for example I have 3 people with 1 hit, 1 person with 7 hits and 1 person with 8 hits, the results now show as

                   

                  uuid           dayused                         hits                            sum(hits)

                  496833          02/04/2013                    1                                      3

                  496833          02/04/2013                    7                                      7

                  496833          02/04/2013                    8                                      8

                  • Re: Set Analysis
                    Gysbert Wassenaar

                    try sum(total <dayused> hits)