1 Reply Latest reply: Mar 19, 2018 1:06 PM by Digvijay Singh RSS

    Conversion of data question

    Bharat Srinivas Parthasarathy

      Hi all,

       

      I am creating a dashboard from a Mysql table. One of the columns in the table is days which provides data ranging from 1-7 in the format 1,2,3 or 1,2,3,4 which corresponds to Sun,Mon,Tues and Sun,Mon,Tues,Wed respectively. Please let me know an efficient way to map the numbers to the days. Thanks.

        • Re: Conversion of data question
          Digvijay Singh

          Different ways are available to achieve this -

          You may have mapping table -

          Days_Map:

          Mapping load

          * inline [

          DayNum, Days

          1,Sun

          2,Mon

          3,Tue

          4,Wed

          5,Thu

          6,Fri

          7,Sat

          ];

           

          Use Dual(Applymap('Days_Map',actualfieldname),Actualfieldname) as Newfieldname

           

          Dual will help to use the same field in calculation as well, in visualization it will show the days in text.

           

          If you have date field available and you have possibility to create days field from that then you can use date functions Day(Date) function to have the same dual field directly.