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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Specialist
Specialist

Splitting Budget into years

Hi Team,

I have  a below data set:

Budget:

Load * inline [

Budget, Amount

WLP00, 200000 ];

 

I don't have any year or month as the budget is allocated overall, All i know is the fiscal year is starting from 2010 and till now.

 

I have tried below:-

 

let vMinDate= Num('1/1/2013');
let vMaxDate= Num(Today());

Temp:
Load
if(RowNo()=1, Date($(vMinDate), 'DD/MM/YYYY'), Date($(vMaxDate) + RowNo(), 'DD/MM/YYYY'))as Date
AutoGenerate (1)
While $(vMinDate) + RowNo() < $(vMaxDate);

join

Final:
LOAD *,
Num(Amount/12) as New_Budget
Resident Budget;
drop table Budget;

exit script;

 

From the above, it is giving me all the dates for every year , day and month. For instance i am getting Dates like 01/01/2013, 12/2/2020,13/2/2020...,01/03/2020,01/04/2020.........20/03/2027.

It is giving me the future dates which i don't need  and also the dates for 2020 years is starting from the Feb month . It is not showing dates for 2014,2015 and so on.

 

My requirement is i only want dates for every years starting month. For ex:- 01/01/2010, 01/02/2010...01/12/2010........01/02/2020.

 

Can anyone please help urgently ??????

1 Solution

Accepted Solutions
Aspiring_Developer
Specialist
Specialist
Author

I have solved it myslef

 

Make a new table and load date in it and take the resident if temp table and put where condition

Final:

Load

Date

Resident temp

where day(Date)=1;

drop table temp;

View solution in original post

2 Replies
Taoufiq_Zarra
MVP
MVP

from the input data, what is the expected outpout?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Aspiring_Developer
Specialist
Specialist
Author

I have solved it myslef

 

Make a new table and load date in it and take the resident if temp table and put where condition

Final:

Load

Date

Resident temp

where day(Date)=1;

drop table temp;