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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

# count

Hi all,

I want to count the total of trucks used in my table.

Dimension = Week, performanceday

Expression = count(distinct(trucks))

now I like to only count monday -> friday so i was thinking about this:

count(DISTINCT{< Year = {$(=(max(Year)))}, PerformanceWeekday = {'mo'} + PerformanceWeekday ={'tu'} + PerformanceWeekday ={'we'} + PerformanceWeekday ={'th'} + PerformanceWeekday ={'fr'} >}trucks)

i'm pretty sure this won't work so whats the best solution?

kind regards

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

count(DISTINCT{< Year = {$(=(max(Year)))}, PerformanceWeekday = {'mo','tu','we','th','fr'} >}trucks)

View solution in original post

5 Replies
manojkulkarni
Partner - Specialist II
Partner - Specialist II

can you post you application ? Instead of putting so many set, it can be achieved by adding one flag for performance.

MK_QSL
MVP
MVP

count(DISTINCT{< Year = {$(=(max(Year)))}, PerformanceWeekday = {'mo','tu','we','th','fr'} >}trucks)

its_anandrjs
Champion III
Champion III

Hi,

In place of this you have to load data from Monday to Friday and max year then it will show right data.

Thanks & Regards

Not applicable
Author

god how could I make such an error. thanks!

senpradip007
Specialist III
Specialist III

Hi

try like this:

count({< Year = {$(=(max(Year)))}, PerformanceWeekday = {"*"} - {'Sat','Sun'} >} DISTINCT trucks)

I assume that PerformanceWeekday holds the weekday name, eg- Sat,Sun,Mon, etc