Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to count the number of times that different values appear in a table. There is an 'ID' column and I would like to generate an 'Instances' column that counts up the number of times a value appears. For example, if the 'ID' = 2, the calculation will find all the instances where this is true and give the result. I would like it not to be hard-coded to look for individual ID numbers, as the data changes a lot. I have attached an example of how I would like the data to be shown. I would like to avoid using the script editor as most of my data is managed in the data manager.
Any help appreciated, Sophie 🙂
Hi Sophie,
I assume that you want this to be done in the script, correct? So, if your original data table is called Tab1, I'd use something like this:
LEF JOIN (Tab1)
LOAD
ID,
count(ID) as [Instances of ID]
resident
Tab1
GROUP BY
ID
;
To learn more advanced development techniques, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin!