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

'Secondary' Calculations in Loadscript?

Hi there,

I am working with Twitter data. Each tweet has a User ID (who sent it), and a classification: Boo, Cheer, Other.

I want to calculated, as a percentage by user, Boos, Cheers and Others.

I.e. Alex sent 10 tweets, three boos and seven cheers.

Alex's boo percentage is 30%.

This has to be at a user level so I can roll it up - i.e. the average boo % across all the users (calculated at a user level) is 15.3%.

I tried a load where I had

LOAD

Username,

count(Boos)/count(Tweet ID) as % Boos

But that didn't work. Any ideas? Thank you so much.

1 Solution

Accepted Solutions
sunny_talwar

Did you use the group by statement?

LOAD Username,

          Count(Boos)/Count(Tweet ID) as % Boos

Resident source

Group By Username;

View solution in original post

3 Replies
sunny_talwar

Did you use the group by statement?

LOAD Username,

          Count(Boos)/Count(Tweet ID) as % Boos

Resident source

Group By Username;

Not applicable
Author

Genius!

sunny_talwar

Awesome

I am glad it worked.

Best,

Sunny