Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Can i load only the counts of values in a column from the DB instead of loading the whole column.
For example: I have login table where we will save the user details like user_id, login_date, and some more... every time when user logged in.
Now i need just count(user_id) which give the number of logins.
My scenario is instead of loading the whole data, i need to apply set analysis in the load script itself.
Is all functions like max, sum, count can be used in load script in Qlik sense?
Regards,
Kumar
You can use all the functions you mentioned, but not Set Analysis in the script. However, that you should not be worried about, because you can achieve your goal in the script without that. Try like:
Load
user_id,
Count(user_id) as user_count
from <> Group By user_id;
'Group By' is important when using any aggregation function in the script. Learn about it.
Yes, you can use all mentioned function at script level. As these function are aggregate function so you need to group them which you can do by Group By.
Set Analysis is used at front end not at script level, but yeah as tresesco mentioned their are alternates to achieve your goal with the same output as it is done by Set Analysis at UI level, same you can achieve at script level too.
I don't want load user_id, but only Count(user_id) as user_count.
Is this possible?
Possible. Try it and let know if any issues.
NO, I am getting error as odbc failed...
screen shot your piece of script and tell us the type of database you are using. So people can help you better.
For example
[UserVisit]:
LIB CONNECT TO [Your DB];
LOAD [NumberVisits];
SQL SELECT COUNT(user_id)
FROM db.dbo.LoginTable;
Should get you the answer you want with a little tweeking