Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have used the code to cretae my From Date and To Date Calender.
Attached is the code
It is working fine
I want little bit customisation to be done to it
My date data from the Date table is starting from 6th Jul 2009 where as in calender it will start from 1st
Can i default mu start date in my calender to 6th Jul 2009
And my to date should be greater than my start date in my case it should be gretaer than 6th Jul 2009
How can i achieve this
Regards
arvind
Try this script.
MaxMinDate:
Load
max(Date) as MaxOccurredDate,
min(Date) as MinOccurredDate
resident Incident;
Let vMaxOrderDate = num(peek('MaxOccurredDate',0,'MaxMinDate'));
Let vMinOrderDate = num(peek('MinOccurredDate',0,'MaxMinDate'));
Calendar:
Load
*,
Day(Start_Date) as SDay,
Month(Start_Date) as [SMonth],
Year(Start_Date) as [SYear]
;
Load Date($(vMinOrderDate ) + rowno() -1) as Date
Autogenerate 1
While Date($(vMinOrderDate ) + rowno() -1) < date($(vMaxOrderDate ))
Calendar2:
Load
*,
Day(Start_Date) as SDay,
Month(Start_Date) as [SMonth],
Year(Start_Date) as [SYear]
;
Load Date($(vMinOrderDate ) + rowno() -1) as Date
Autogenerate 1
While Date($(vMinOrderDate ) + rowno() -1) < date($(vMaxOrderDate ))
Regards,
Kaushik Solanki
Hi Kaushik,
It is giving parameter error
attached is the screenshot
Regards
Raj
Hi,
It is because the variables are null, they are unable to get the data from max table.
Try this script
MaxMinDate:
Load distinct
max(Date) as MaxOccurredDate,
min(Date) as MinOccurredDate
resident Incident;
Let vMaxOrderDate = num(peek('MaxOccurredDate',0,'MaxMinDate'));
Let vMinOrderDate = num(peek('MinOccurredDate',0,'MaxMinDate'));
Calendar:
Load
*,
Day(Start_Date) as SDay,
Month(Start_Date) as [SMonth],
Year(Start_Date) as [SYear]
;
Load Date($(vMinOrderDate ) + rowno() -1) as Date
Autogenerate 1
While Date($(vMinOrderDate ) + rowno() -1) < date($(vMaxOrderDate ))
Calendar2:
Load
*,
Day(Start_Date) as SDay,
Month(Start_Date) as [SMonth],
Year(Start_Date) as [SYear]
;
Load Date($(vMinOrderDate ) + rowno() -1) as Date
Autogenerate 1
While Date($(vMinOrderDate ) + rowno() -1) < date($(vMaxOrderDate ))
Regards,
Kaushik Solanki
Hi Kaushik,
Thanks for the reply
But i got error same
Error in expression date Takes 1-2 parameters
Also i wanted to know in my original code
I used 2 calender scripts one i called as start Date and the other i called as End Date
But in your script i found in both the calender code u kept as date only
How do i choose in UI calender object which one is to be used as from Date field and which one to use as To Date Field
I want that my start date from calender object 1 should start from 6th Jul 2009
and my To Date in calender object should be gretaer than 6th July 2009
Thanks in advance
Regards
Raj
Hi,
Kindly post your qvw file with the backup data.
Regards,
Kaushik Solanki
Hi Kaushik,
Attached is the test qvw which is working fine between dates
From Date and To Date
Please help me with setting From date in calender default to 6th Jul 2009
and in From Date calender object i want the date greater than 6th Jul 2009
Regards
Raj
Sorry in above reply From Date should default to 6th Jul 2009
and To Date should be greater than 6th Jul 2009
Sorry in above reply From Date should default to 6th Jul 2009
and To Date should be greater than 6th Jul 2009
Hi,
There is no data in the test file uploaded by you.
Kindly check and upload the correct one with QVD or base data for Reload.
Regards,
Kaushik Solanki