Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Master calendar with Timestamp

Hi

can someone upload an example script for a master calendar with Date and Time PLEASE

I am trying to use the following script:

But I am getting an error

a:

Load ID,

     SaleDate,

     floor(SaleDate) as SaleDateKey

;

LOAD * INLINE [

    ID, SaleDate

    1,2017-07-16 20:00:00

    2,2017-07-16 21:00:00

    3,2017-07-17 12:00:00

    4,2017-07-17 13:00:00

    5,2017-07-17 15:00:00

];

MinMaxDates:   

    LOAD Floor(Min(TimeStamp#(SaleDate, 'DD/MM/YYYY hh:mm:ss'))) as MinDate,    

         Floor(Max(TimeStamp#(SaleDate, 'DD/MM/YYYY hh:mm:ss'))) as MaxDate   

    RESIDENT a;   

     

    LET vMinDate = FieldValue('MinDate', 1);   

    LET vMaxDate = FieldValue('MaxDate', 1);    

       

    DROP TABLE MinMaxDates;    

     

     

    MasterCalendar1: 

    LOAD *, 

         Hour(AddedTimeStamp) as Hour, 

         Day(AddedTimeStamp) as Day,       

         Month(AddedTimeStamp) as Month;

    LOAD  

      DayStart(TimeStamp($(vMinDate) + (RecNo()/60/24) + (IterNo() -1))) as AddedDate,  

        TimeStamp($(vMinDate) + (RecNo()/60/24) + (IterNo() -1)) as AddedTimeStamp   

    AUTOGENERATE 1439  

    WHILE Num($(vMinDate) + IterNo() -1) <= Num($(vMaxDate)); 

15 Replies
Not applicable
Author

yes,tex object.

I have 2 types of calendars:

Calander I - in witch the user can select year, month, day. (vmindate & vmaxdate

Calander II - in witch the user can select date as well as time (vstartdate & venddate)

I want to create a text object that will calculate :

1. If the user select dates in calander I - count(DISTINCT {<SaleDate_DateFormat={">=$(vMinDate) <=$(vMaxDate)"}>}ID)

2. if the user selects date & time rage in calander 2 - count(DISTINCT {<SaleDate={">=$(VstartDate) <=$(VEndDate)"}>}ID)

Thanks

sunny_talwar

I am only seeing a single master calendar in your app... I guess based on the selections you have in there what is your expected output?

Not applicable
Author

what I mean is that I have 2 calendars in the user interface....

the outcome should be the count of ID`s regardless of which calendar the user is using  (but according to the user`s selection on the calendar used)

I hope its clear, if not - let me know.

thanks

sunny_talwar

I guess it will help me if you can tell me the numerical output (like count will be 10) for the given selections and may be another set of outputs based on other selections.

Not applicable
Author

Ok,so I changed the variable Vmindate (attached new qvw)

if the user selects in calendar 1 the values:

year=2017

month=jul

day=17

the expected  result= 5

if the user selects in calendar 2 ,the following time range

2017-07-17 00:00:00

to

2017-07-17 15:00:00

the expactedresult=3

piotr-bratek
Contributor III
Contributor III

Hi Sunny,

is the Master Calendar with Hours, Minutes &amp; Seconds article somehow restricted? I get a message "You do not have sufficient privileges for this resource or its parent to perform this action."

cheers
Piotr

ex-Training Manager at Qlik Central-Eastern Europe