Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
hamdaniahmad
Contributor III
Contributor III

Creating daily target

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 :

upload.jpg

Anyone can help me?

Thanks anyway

1 Reply
PradeepReddy
Specialist II
Specialist II

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