Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to flag clients?

I just created a straight table which calculates for how many distinct years a client has generated sales. Now I have a list of customers and the number of years they were active. I would like to create a flag within clickview that will enable me to select clients with 4 distinct years of business, 3, 2, and so on. What is the best way for me to do this? Thanks in advance.

1 Reply
michael_anthony
Creator II
Creator II

You could try creating a list box.

Instead of selecting a field, use an <Expression> and put in:

=Aggr(Count(Distinct Year),Client)

you can then select from the listbox which # of distinct years and it will return the clients related to that. It will filter down if you make any selections, so if want it to always work on the total, may have to include a Set Analysis expression {1} as part of the count.

You could also pre-calculate in the script and attach to each client record.

Eg. Create a table

clientCount:

LOAD

Client,

Count(Distinct Year)) as clientyearCount

Resident facttable

group by Client;