5 Replies Latest reply: Sep 13, 2017 8:16 AM by Brice SACCUCCI RSS

    group by: need a Timestamp in a group by statement?

    Christian Schmitz

      Hi,

       

      I have a question regarding my group by statement.

      I am loading following table with a Time_Stamp, which is generated with num(today()). So for every row there will be a identical number from today as Time_Stamp, e.g. "42990" for 12.09.2017.

       

      Do I really need to put num(today()) in the group by? I have tried it without and it seems to work, but I remember the rule for group by was to put all fields in the group by which are not summed.

       

      Can anybody please explain? Thx Chris

       

       

      Load sum(Rev) as Rev,

                SoS_Year, //1

                Geo_From_Subregion_Group_Name, //2

                Geo_To_Subregion_Group_Name,  //3

                num(today()) as Time_Stamp //4

       

      Resident fact_table 

       

      group by SoS_Year,

      Geo_From_Subregion_Group_Name,

      Geo_To_Subregion_Group_Name

      //     ,num(today())

      ;