1 Reply Latest reply: Feb 15, 2016 1:10 PM by pradeep t RSS

    Creating daily target

    Ahmad Hamdani

      Dear QlikView Master,


      I'm analyze data for a daily target, but my problem is the data provide by monthly,

      if I divide by total days total will not same with original target (+ or -).


      I tried to use div function and mod function, but I have problem in result to divide by daily.


      Example :

      Month = Jan 16 (31 Days)

      Sales Target = 70

      div(70,31) = 2

      mod(70,31) = 8 <<< How to give out this result into 1 - 8 first days?


      My Expectations :



      Anyone can help me?


      Thanks anyway

        • Re: Creating daily target
          pradeep t

          this is not the good thing, showing month level data in day level...


          However the bellow script may helps you..


          Load *,

                if(day(Date_Field)<=8, mod((Sales Target), Ceil(MonthEnd(Date_Field())-MonthStart(Date_Field()))),

                 div((Sales Target), Ceil(MonthEnd(Date_Field())-MonthStart(Date_Field())))) as Daily_Target

          From Source;


          Ceil(MonthEnd(Date_Field())-MonthStart(Date_Field()))) --> will give you no of days in a month