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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
natisham
Contributor II
Contributor II

Count in a certain date

Hello,

Im trying to count Engine hours over 40 hours by week. So I just need it to read

Header 1Header 2
Engine Hours over 407
Engine Hours under 25

It would count Machine Names with over 40 Engine hours per week.

Currently I have :

Count({$<[Engine on (h)]={"<2"}>}[Engine on (h)])       but it is giving me the total and not counting the number of weeks it ran under 2 hours.

Please help.

11 Replies
Anil_Babu_Samineni

Better if you provide 5 rows data set and expected result set

Count({$<[Header 1] = {"=SubField([Header 1], ' ', -1) <= 2"}>} [Header 1])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
zebhashmi
Specialist
Specialist

Count({$<[Engine on (h)]={"<2"}>}[Engine on (h)])

Your formula is perfectly fine use it in KPI

sunny_talwar

Is Header1 your field Engine on (h)?

natisham
Contributor II
Contributor II
Author

Yes Engine on (h) is my header. When I use Count({$<[Engine on (h)]={"<2"}>}[Engine on (h)]) i am getting a total of the hours instead of how many times it went over 40 in a week span

natisham
Contributor II
Contributor II
Author

Sorry meant under 2 instead of over 40

sunny_talwar

Does Engine on (h) include numeric values? Can you share a screenshot of your Engine on (h) field?

natisham
Contributor II
Contributor II
Author

They are all Numeric values

sunny_talwar

Screenshot?

natisham
Contributor II
Contributor II
Author

Engine.PNG

I have the table below (customer name has been changed):

Table.png

The Numeric numbers are per weeks for Engine on (h)