5 Replies Latest reply: Jun 9, 2017 10:40 AM by Vijayanth Radha RSS

    Help is writing an expression

    Vijayanth Radha

      I need help with the following use case


      List all values of a dimension which coexist the most with the current selection in the same dimension.


      If a box can hold multiple color balls, for example if I select green, I want to list the colors that exist the most where color is green


      The sql is something like this:


      SELECT color, COUNT(*) FROM table

      WHERE id in

      (select id  from table where color is selectedcolor)

      and color is not null

      and color <> selectedcolor

      group by color

      order by 2 desc