From Date & To Date Selection Script Solution

    Hi Qlikers,


    I have written this blog to showcase how from date & to date can be used to select the date ranges in QlikView associative model.



    Let's say I want to calculate count of employees joined in organization between 1/1/2017 to 15/1/2017. So here reference date would be Date of joining.


    There are many ways to achieve above scenario.

    Option 1 - Create two data Island table (From Date & To Date). Select From date & To Date from data Island table and store the values in respective variables (vFromDate, vToDate). These variables now can be used in set analysis to get desire output.

    Option 2 - Create From Date & To Date table in data model which is associated with Fact table.


    There could be other ways also to achieve the above scenario.

    Though option 1 is easy to implement, on large data set it could cause performance issue as we are using data Island.


    Below is the screenshot of data model created with Option 2.



    Advantage of using this approach is, calculation will be performed on associated data which can give faster results as compared to option 1 approach.


    I have attached qvw file.


    Feel free to provide any suggestions.



    Kushal Chawda