2 Replies Latest reply: Aug 8, 2017 11:34 AM by Bill Markham RSS

    Adding averages

    Juan Moreno

      Hi,

      The following expression is working for me in Qlik Sense, but I wonder if there's a way to write it shorter/cleaner:

       

      Avg({<LinkId={'254930'}, DayName-={'Sat','Sun'}, TimePeriodIdx={'>=24'}, TimePeriodIdx={'<40'}>}TravelTime)/ 60 +

      Avg({<LinkId={'254950'}, DayName-={'Sat','Sun'}, TimePeriodIdx={'>=24'}, TimePeriodIdx={'<40'}>}TravelTime)/ 60 +

      Avg({<LinkId={'254920'}, DayName-={'Sat','Sun'}, TimePeriodIdx={'>=24'}, TimePeriodIdx={'<40'}>}TravelTime)/ 60 +

      Avg({<LinkId={'254970'}, DayName-={'Sat','Sun'}, TimePeriodIdx={'>=24'}, TimePeriodIdx={'<40'}>}TravelTime)/ 60 +

      Avg({<LinkId={'254990'}, DayName-={'Sat','Sun'}, TimePeriodIdx={'>=24'}, TimePeriodIdx={'<40'}>}TravelTime)/ 60 +

      Avg({<LinkId={'255040'}, DayName-={'Sat','Sun'}, TimePeriodIdx={'>=24'}, TimePeriodIdx={'<40'}>}TravelTime)/ 60

       

      I expected to be able to do something like:

       

      Sum({<LinkId={'254930','254950','254920','254970','254990','255040'}>}Avg({<DayName-={'Sat','Sun'}, TimePeriodIdx={'>=24'}, TimePeriodIdx={'<40'}>}TravelTime)/ 60)


      That does not work. Any idea to simplify the expression?

       

      Thanks,

       

      Juan