3 Replies Latest reply: Oct 11, 2018 3:33 PM by Andrey Krylov RSS

    Need urgent help in previous week set expression

    Praveen Prabhu



      I need help on previous week calculation. I am trying to calculate a percentage value for previous week using below expression.

      num((((sum({$<[received_date]={">=$(=Date(WeekStart(Max([received_date]),-1, 0),'YYYY-MM-DD'))<=$(=Date(WeekEnd(Max([received_date]),-1, 0),'YYYY-MM-DD'))"}>}[shop_1])+sum({$<[received_date]={">=$(=Date(WeekStart(Max([received_date]),-1, 0),'YYYY-MM-DD'))<=$(=Date(WeekEnd(Max([received_date]),-1, 0),'YYYY-MM-DD'))"}>}[shop_2]))/sum({$<[received_date]={">=$(=Date(WeekStart(Max([received_date]),-1, 0),'YYYY-MM-DD'))<=$(=Date(WeekEnd(Max([received_date]),-1, 0),'YYYY-MM-DD'))"}>}[Total Build])))*100,'#.##')

      But i am not getting any answer when applied this expression.


      In simpler terms without the set analysis, it is (sum(shop_1)+sum(shop_2))/sum(total_build) for previous week.

      Below is my data for previous week and i have highlighted in a circle, the answer i am looking for.


      Kindly help me in resolving the above issue as i am very new to Qlikview.



      Praveen Prabhu