Monday, April 15, 2019

Loading a set of Excel files from a folder into QlikView

Good Day,
All of you.

In the process of building a data model in QlikView/Qlik Sense sometimes we may require to load a set of files like .txt,.csv or .xlsx/.xls, but assume a case where we need to load a set of 100 files which are snap shots of data like complete weeks data kept on next Monday with a Date to it, like below.

Now here is the task to load all the files at once with out loading them individually and this has to happen every time when we are loading the qvw file such that all the older files plus the new file should be loaded. This can be achieved with a loop in QlikView/ Qlik Sense, below is one such script which I used in my real time. Hope this helps you.


Note: One thing to be observed here is the name of the files are the same but with a different date at the end.

//Code Used:

let vQlikTech = 'Your Folder Path';

Directory $(vQlikTech);

let i= 1;

For each File in filelist ('Risk Register_*.xlsx')

Risks1:     //to get sequence Snopshot ID
Load
RowNo() as Test
AutoGenerate 1;

i= peek('Test')+i;

drop table Risks1;

Concatenate
Load
*,
Date(Date#(subfield(SubField(FileName(),'_', 2),'.xlsx',1), 'DD.MM.YYYY'))as "Snapshot Date",
'$(i)' as "Snapshot ID"
FROM $(File)
(ooxml, embedded labels, table is owssvr);

Next File;






Monday, April 8, 2019

What is Section Access - For Qlik Beginners

Good Day,
All of you.
To start with a simple quote.....

                                                 ** Repetition is the crux of Education **
Section access is one such topic which can be discussed for hours together as it has a greater usage in QlikView/Qlik Sense.

First of all
What is the use of Section Access ?
Lets take a simple scenario.
A university is maintaining students data in a data base and created some analytics over that and shared that files to all the Department heads using QlikView Access point. Now the rule here is when a Department head opens that file he has to see analytics of his students not the other department students.....

Hope you got the requirement. To make it simple

University contains - 7000 students
--------------------------------------------
IT Dept                   - 1000 students
ECE Dept               - 1500 students
MCA Dept             - 1000 students
MBA Dept             - 2000 students
Civil Dept              - 1500 students

Now if a Department head of IT Dept logs in to the file, how many students analytics he has to see ?
1000 - Correct!

This is section access, it means the original file is loaded with all students data but when a department head open the file he has to see his student data only.

This concept is also known as Data Reduction (or) Row Level Security as the security is on the data or on the rows.

Hope this makes sense on understanding What is Section Access in QlikView/Qlik Sense.


I will come up with some more concepts on Section access with examples to practice in my next posts.