Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MeeraAgrawal
Creator
Creator

Data Load script

Hi All,

I have loaded file from local and I want to apply count function on CAT_ID field but when I am trying to load data its throwing up an error. 

1 Solution

Accepted Solutions
tm_burgers
Creator III
Creator III

I am not sure what you goal with the 2nd Count function is since you haven't added the resident table or a group by statement?

 

Both these counts could be done in Analysis rather than in the load script if you don't need those tables separately.

 

The error you are getting doesn't match the script tables you have shown in your screenshot; the error says it is with the script for "navigation_details" - is this table loaded in a different area of your script?

 

 

View solution in original post

4 Replies
tm_burgers
Creator III
Creator III

I am not sure what you goal with the 2nd Count function is since you haven't added the resident table or a group by statement?

 

Both these counts could be done in Analysis rather than in the load script if you don't need those tables separately.

 

The error you are getting doesn't match the script tables you have shown in your screenshot; the error says it is with the script for "navigation_details" - is this table loaded in a different area of your script?

 

 

MeeraAgrawal
Creator
Creator
Author

Hi @tm_burgers 

Now I have write this script newly separated window. and it's working fine now after using Resident keyword.

[category_sort]:
LOAD
CAT_ID
FROM [lib://DataFiles/category_sort.csv]
(txt, codepage is 28592, embedded labels, delimiter is '\t', msq);

Load CAT_ID, Count(CAT_ID) AS Category_COUNT Resident category_sort Group By CAT_ID;

 

Note* Can you please help me why we use Resident keyword. 

If we can use direct operation from chart then what are additional benefits to do same things via script editor.

tm_burgers
Creator III
Creator III

The resident keyword is to tell the script from which table do you want it to count the data. Basically saying "count thisX , from thisY table"

Regarding why you would perform some operations in script vs in app; it really comes down to the complexity of the operation. For a simple count of categories and a count of CAT_ID;  then having them in App is better, since your selections across your App would reflect the correct change in the counts. 

 

 

 

 

MeeraAgrawal
Creator
Creator
Author

You means we are using scripting for consistency throughout the dashboard.