Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

measure by day

hello everyone,

Hope this finds you well.

I have an excel file that contains the budget by department and by month of date as you can see bellow :

Departementmonth of datebudget
finance01/01/2016500
Information system01/02/20161000

My objective is to display the budget by day and the sum of budget still the same, like that :

Departementcalendar datesum (budget) : 500
finance01/01/2016500
finance02/01/2016500
finance02/01/2016 ......UNTIL 30/01/2016500

could you please help me?

Thanks in advance

11 Replies
swuehl
MVP
MVP

You can do this using a WHILE clause like

SET DateFormat = 'DD/MM/YYYY';

LOAD Departement, Date([month of date]+iterno()-1) as Date, budget INLINE [

Departement, month of date, budget

finance, 01/01/2016, 500

Information system, 01/02/2016, 1000

]

WHILE iterno() <=Day(Monthend([month of date]));

master_student
Creator III
Creator III
Author

Thanks Swuel for your response but the budget sum is 44500 instead of 500. see below:

Capture.PNG

swuehl
MVP
MVP

Ok, I misunderstood your request.

you can create a separate calendar table, so you are not duplicating your budget values.

SET DateFormat = 'DD/MM/YYYY';

INPUT:

LOAD * INLINE [

Departement, month of date, budget

finance, 01/01/2016, 500

Information system, 01/02/2016, 1000

];

Calendar:

LOAD DISTINCT

[month of date], Date([month of date]+iterno()-1) as Date

RESIDENT INPUT

WHILE iterno() <=Day(Monthend([month of date]));


2016-05-08 01_31_52-QlikView x64 - [C__Users_Stefan_Downloads_comm215797.qvw_].png

master_student
Creator III
Creator III
Author

Thanks Swuehl.

I have a calendar dimension :

month start date : 01/02/2016

calendar date : 02/02/2016 ...29/02/2016

Capture.PNG

so I did :

INPUT:

LOAD * INLINE [

Departement, month of date, budget

finance, 01/01/2016, 500

Information system, 01/02/2016, 1000

];

left join

LOAD DISTINCT

[Month start date] as [month of date]

,[%Date ID]

RESIDENT D_Calendar;

but the sum budget is 45500 instead of 500.

Thanks in advance for your help.

swuehl
MVP
MVP

If you join the tables, this will duplicate your facts. Any reason why you want to join your tables?

master_student
Creator III
Creator III
Author

the reason is to get the calendar date from the calendar dimension.

please let me know if you have other solution.

Thank you

master_student
Creator III
Creator III
Author

Any help please.

swuehl
MVP
MVP

Can you tell what's wrong with my previous sample, where I linked the calendar to your fact table?

master_student
Creator III
Creator III
Author

could you please use my calendar dimension.