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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
EQ
Contributor III
Contributor III

Logics in load scripts to calculate the numbers

Hi Expert,

I got a logic issue and need your suggestions and help in load script of Qlikview.

I have a Holiday table as below and another Date table, what I want is that to calculate the NumOfSatSun between the two dates of the Date Table based on the Holiday Table to generate the Final Table~ 

 Would a kind and enlightened please advise on my error, many thanks in advance!

Holiday Table:

HolidayDateHoliday_YearNumOfSatSun
2017/12/2520170
2017/12/3020180
2018/1/120182
2018/2/1520180
2018/2/2120182
2018/4/520180
2018/4/720181
2018/4/2920180
2018/5/120181
2018/6/1620180
2018/6/1820182
2018/9/2220180
2018/9/2420182
2018/10/120180
2018/10/720182
2018/12/2520180
2018/12/3020190
2019/1/120191
2019/2/320190
2019/2/1020193
2019/4/520190
2019/4/720192
2019/5/120190
2019/6/720190
2019/6/920192
2019/9/1320190
2019/9/1520192
2019/10/120190
2019/10/720192
2019/12/2520190

 

DateTable

StartDateEndDate
2017/12/132018/2/7
2017/12/142018/2/23
2018/9/212018/10/10
2019/1/162019/2/12
2019/1/232019/2/21

 

Final Table:

StartDateEndDateNumOfSatSun
2017/12/132018/2/72
2017/12/142018/2/234
2018/9/212018/10/104
2019/1/162019/2/124
2019/1/232019/2/213
1 Solution

Accepted Solutions
Vegar
MVP
MVP

You need to implement intervalmatch.

LOAD 
     HolidayDate, 
     Holiday_Year, 
     NumOfSatSun
FROM
[https://community.qlik.com/t5/QlikView-App-Development/Logics-in-load-scripts-to-calculate-the-numbers/m-p/1552748#M440397]
(html, codepage is 1252, embedded labels, table is @1);

IntervalMatch(HolidayDate)
LOAD 
     StartDate, 
     EndDate
FROM
[https://community.qlik.com/t5/QlikView-App-Development/Logics-in-load-scripts-to-calculate-the-numbers/m-p/1552748#M440397]
(html, codepage is 1252, embedded labels, table is @2);

 

image.png

View solution in original post

3 Replies
Vegar
MVP
MVP

You need to implement intervalmatch.

LOAD 
     HolidayDate, 
     Holiday_Year, 
     NumOfSatSun
FROM
[https://community.qlik.com/t5/QlikView-App-Development/Logics-in-load-scripts-to-calculate-the-numbers/m-p/1552748#M440397]
(html, codepage is 1252, embedded labels, table is @1);

IntervalMatch(HolidayDate)
LOAD 
     StartDate, 
     EndDate
FROM
[https://community.qlik.com/t5/QlikView-App-Development/Logics-in-load-scripts-to-calculate-the-numbers/m-p/1552748#M440397]
(html, codepage is 1252, embedded labels, table is @2);

 

image.png

Vegar
MVP
MVP

Attaching an sample QVW file that reads your post tables

EQ
Contributor III
Contributor III
Author

Hi Vegar,

You genius! That is really I want, thanks!

Eric