IntervalMatch Function in QlikView

What is IntervalMatch function in QlikView?

The Interval Match is one of the functions in QlikView that can be used to match a numeric value in a single table, such as date, timestamp, score, percent or any number, to an interval or duration in a second table. The IntervalMatch function discreet data to one or more dimensions that are changing over time. It can be us for resolving slowly changeing dimensions by linking the specific key fields to the appropriate numeric intervals. It can be used with LOAD, Inline and SQL select statements.

Note

A major and important point is that when we apply the IntervalMatch function to tables, it is necessary that the tables have numeric values.

Advantage

There are given many advantages of the IntervalMatch function.

  • Save time: It saves the time of the QlikView application because joins are not used with the IntervalMatch function.
  • Save memory: It saves the memory of the QlikView application because it avoids loading all the possible numeric values into a fact table.
  • It avoids the case statements concepts.

The following is the procedure to be used to use the IntervalMatch function in a QlikView application.

Step 1: Open the QlikView application

In the first step you need to open the QlikView application then go to File -> New then this window will be opened.

After clicking New option

Step 2: Open Edit Script

The second step is to open the edit script window from File -> Edit Script.

window of edit script

Then this window will be opened.

window

Step 3: Load tables

The next step is to load the tables.

Here I am using an inline load. A LOAD or SQL statement can also be used. It totally depends on your preference.

table

Step 4: Save file

The next step is to save our QlikView file.

save

Step5: Reload the edit script

The next step is to reload the code of the edit script.

reload

Step 6: Sheet property window

The sheet property window will be opened and click on the OK button.

sheet

Step 7: Open edit script again and apply IntervalMatch function

The next step is to open the edit script again and apply the IntervalMatch function in the edit script and reload this code.

reload1

  1. StudentMarks:  
  2. LOAD * Inline  
  3. [  
  4. Min_Marks, Max_Marks, Result  
  5. 10, 30, Fail  
  6. 35, 40, Pass  
  7. 45,60, Average  
  8. 75,80, Honour  
  9. ];  
  10.   
  11. StudentDetail:  
  12. LOAD * Inline  
  13. [  
  14. Marks, StudentName  
  15. 30, Ram  
  16. 40, Shyam  
  17. 60, Mohan  
  18. 80, Mahesh  
  19. ];  
  20.   
  21. IntervalMatch_Table:  
  22. IntervalMatch(Marks)  
  23. LOAD Min_Marks, Max-Marks  
  24. resident StudentMarks;    
Step 8: Sheet property window

The sheet property window will be opened. Here you can see the Marks field is matched from the IntervalMatch function and two fields are loaded.

sheet2

Now you will see this result.

output

Summary

This article describes what the IntervalMatch function is in QlikView and describes how it will be used in tables.

Up Next
    Ebook Download
    View all
    Learn
    View all