Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I am relevantly new to Qliksense and was hoping to get some guidance.
I need to loop through multiple different data connections and establish the row count of each file/table within the connection.
Is this possible on Qliksense and if it is does anyone have an example load script to do this ?
Thanks
Hello,
If my understanding is correct, then you have some connections with data sources and you want to count the rows in every connection. Hypothetically, speaking this might not be 100% possible to achieve. Please allow me to explain why I believe that your specific use case scenario is not possible.
Data connection:
A data connection is essentially just a connection to the source where the data is connected. This can be either a folder with files (EXCELs, CSVs, QVDs etc.), a database such as (MySQL, PostgreSQL etc.) and other data sources. The connection it self, doesn't define the data within the connection so you can't just count the rows.
Loading data example:
LOAD
Havan,
MetaData
FROM [lib://test/Book2.xlsx]
(ooxml, embedded labels, table is DataSheet);
From the script above we are loading the fields Havan and MetaData from a connection with the data source so we can count how many rows of data are there. There are a couple of issues if you want to repeat this process for multiple connections. For example:
It is almost impossible to write a script that will iterate through different connections, different types of connections, take into consideration how the data is loaded within each connection, find the right table names etc. Another example is:
As you can see the connection path is different, the sheet is different, the fields in each load are different, the file is different so there is no easy way of actually writing a script that would take all these differences into consideration and those connections all refer to folder connection type. So if you are about to introduce other types of connection, then this is going to get even more complicated.
The ideally environment where this could be possible is to have the following requirements:
Then you can only make a For...Next statement that will execute the exact same script (with only the differences being the numbers in the files/connections names).
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members.
Hello,
If my understanding is correct, then you have some connections with data sources and you want to count the rows in every connection. Hypothetically, speaking this might not be 100% possible to achieve. Please allow me to explain why I believe that your specific use case scenario is not possible.
Data connection:
A data connection is essentially just a connection to the source where the data is connected. This can be either a folder with files (EXCELs, CSVs, QVDs etc.), a database such as (MySQL, PostgreSQL etc.) and other data sources. The connection it self, doesn't define the data within the connection so you can't just count the rows.
Loading data example:
LOAD
Havan,
MetaData
FROM [lib://test/Book2.xlsx]
(ooxml, embedded labels, table is DataSheet);
From the script above we are loading the fields Havan and MetaData from a connection with the data source so we can count how many rows of data are there. There are a couple of issues if you want to repeat this process for multiple connections. For example:
It is almost impossible to write a script that will iterate through different connections, different types of connections, take into consideration how the data is loaded within each connection, find the right table names etc. Another example is:
As you can see the connection path is different, the sheet is different, the fields in each load are different, the file is different so there is no easy way of actually writing a script that would take all these differences into consideration and those connections all refer to folder connection type. So if you are about to introduce other types of connection, then this is going to get even more complicated.
The ideally environment where this could be possible is to have the following requirements:
Then you can only make a For...Next statement that will execute the exact same script (with only the differences being the numbers in the files/connections names).
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members.