3 Replies Latest reply: May 12, 2016 7:13 AM by Stefan Wühl RSS

    how to get independent values or totals from the below expression

      Hi,

       

      how to get independent values or totals from the below expression wherein i am getting the single total value :

       

      =If((WeekDay(timedataend1)='Sat') or (WeekDay(timedataend1)='Sun') AND Time(Frac(timedataend1))>=Time('20:00:00') AND Time(Frac(timedataend1))<=Time('09:59:59'),sum((channelvalue)/1000*13),If((Time(Frac(timedataend1))>=Time('13:00:00') AND Time(Frac(timedataend1))<=Time('16:59:59')),sum ((channelvalue)/1000*15),sum( (channelvalue)/1000*11)))

       

      Detailed description :

      I need three seperate totals to show in the chart :

       

      =If((WeekDay(timedataend1)='Sat') or (WeekDay(timedataend1)='Sun') AND Time(Frac(timedataend1))>=Time('20:00:00') AND Time(Frac(timedataend1))<=Time('09:59:59'),Total A,If((Time(Frac(timedataend1))>=Time('13:00:00') AND Time(Frac(timedataend1))<=Time('16:59:59')),Total B,Total C)

       

        • Re: how to get independent values or totals from the below expression
          Stefan Wühl

          A single expression will always return a single value, unless you are using dimensions to split expression results into parts.

           

          Hence, if you want to show three lines / bars etc. for your Totals, you can't just use a single expression, you need to use either three expressions or a dimension ( could be a synthetic dimension using ValueList()).

           

          I assume you are either using dimensions already or you are selecting to a single record, because you are not using aggregation functions in your conditions.

           

          I am not really sure what you are trying to achieve, so some sample data records and your exected result would definitely help.

           

          Besides that, note that a boolean statement like

           

          Time(Frac(timedataend1))>=Time('20:00:00') AND Time(Frac(timedataend1))<=Time('09:59:59')


          will never be TRUE (a single timedataend1 value obviously can't fulfill the condition).