What is QlikView IntervalMatch – Match Function in QlikView
Keeping you updated with latest technology trends, Join DataFlair on Telegram
In our last session, we talked about QlikView List & Multi Box. Here, in this QlikView Intervalmatch Tutorial, we will discuss an example of Intervalmatch in QlikView. Along with this, we will define what is Match Function in QlikView and its example.
QlikView IntervalMatch and Match Functions are unique features in QliKview. Both of these functions have great applications in industrial setups or anywhere where data records are changing at a certain rate.
2. QlikView IntervalMatch Function
QlikView IntervalMatch function is said to be of use because it matches a numeric value from or within one table to a duration or intervals in another table. The numeric values can be anything like a data, score, timestamp etc. IntervalMatch Function in QlikView is defining data associated with changing dimensions that change with time.
There are many advantages of QlikView IntervalMatch function as you can keep a track of deviations from normal patterns through it. We will understand this better in the coming section. Also, it helps to save QlikView’s in-memory as you don’t need old, repetitive data to match it with the current one but can just do it by applying this function.
Do you know about Properties of QlikView Documents?
3. QlikView IntervalMatch Example
You can apply QlikView IntervalMatch function in many scenarios but let us consider one for our practice now. We will take an Airport scene, where the gates A, B, C, D and E have fixed boarding and departure times respectively. We will also load inline the ActualDeparture timings from these and the apply IntervalMatch function to check the delay from scheduled timings.
First, we have loaded inline data of flight schedules for this example. You can see it in the screenshot attached below. Once we have out FlightSchedule and Events table, we will apply IntervalMatch function.
FlightSchedule: LOAD * INLINE [ BoardingTime, Departure, GateNo 10:15, 11:00, A 7:35, 8:20, B 4:45, 5:15, C 11:20, 12:10, D 8:30, 9:15, E ]; Events: LOAD * INLINE [ ActualDeparture, Gate 11:00, A 8:15, B 5:17, C 12:40, D 9:25, E ]; IntervalMatch(ActualDeparture) LOAD BoardingTime, Departure Resident FlightSchedule;
Now, after saving our document and script, click on OK and reload the script by CRTL+R. Go to the LAYOUT option and create a new sheet object. You can create anything you want to, a table box, list box etc. We have created a list box here. You can select from the fields available. You can see a key sign in front of the fields on which QlikView IntervalMatch function is applied.
Read about QlikView Scripting and Features of QlikView Script Editor
Click on OK and you will get List boxes or a table box showing all the data which can be easily interpreted to calculate the delay in flight departure.
4. What is Match Function in QlikView?
With Match Function in QlikView, you can match a string value expression with the data in the table columns related to it. Instead of searching for your desired information in a long and data-heavy table. You can simply apply match function and mention the expression you are looking for and you will get the entire data in residing in the table related to it.
Do you know How QlikView Works and its Architecture
5. Example of QlikView Match Function
Let us see the working of Match Function in QlikView. We have used our Productrecords.csv file data to apply this function on.
There are two kinds of match functions in QlikView,
a. Match() Function
Using the QlikView match function you can specify your string expression in the script where the main table is loaded. Then save and reload the script. Upon creating a table box or if it is already created as soon as you reload your new script with the match function added, the table will only show rows of the expression you specified.
LOAD Product_Id, Product_Line, Product_category, Product_quantity, Product_cost FROM [C:\Users\admin\Desktop\Dataflair\productrecord.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq) where Match(Product_Line, 'Arts & Entertainment','Home & Garden')
Like here in our screenshots, you can see that we called for Arts & Entertainment and Home & Garden. And in the table box, only these columns are displayed eliminating the other table.
b. Wildmatch() Function
Although the Wildmatch function is not that different from the Match function in QlikView, it is made to ease up your work on Qlikview even more. With this function, instead of typing the whole and exact string expression, you are looking for. You can mention any three continuous letters from the first word of the expression.
Follow this link to know about QlikView Navigation Pane
LOAD Product_Id, Product_Line, Product_category, Product_quantity, Product_cost FROM [C:\Users\admin\Desktop\Dataflair\productrecord.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq) where wildmatch(Product_Line, '*lth*','Foo*');
Like we have done here, we mentioned ‘*lth*’ from Health & Beauty and ‘Foo*’ from Food, Beverages & Tobacco. The resultant table box will show the data from these columns.
So, this was all about QlikView IntervalMatch Function. Hope you like our explanation on Match Function in QlikView.
Hence, learning about these two new functions must be refreshing. If you have prior knowledge of SQL you must be having a familiar feeling about these functions. So, we studied all about the Qlikview IntervalMatch and Match functions with their examples. Furthermore, if you have any doubt, feel free to ask with us!
Till then keep practicing!