Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
fmazzarelli
Partner - Creator III
Partner - Creator III

COUNT

Hi Community

count({<PRIORITY = {'Low'}>,<TEMPOTRASCORSO = {'>=0 AND <=24'}>} [TICKET])

count({<PRIORITY = {'Low'}>,<TEMPOTRASCORSO = {'>=25 AND <=50'}>} [TICKET])

count({<PRIORITY = {'Low'}>,<TEMPOTRASCORSO = {'>=51 AND <=100'}>} [TICKET])

EXAMPLE

TABLE

PRIORITY     TEMPOTRASCORSO

low               34

low               1

low               292

normal          23

normal          2

urgent          3

urgent          40

urgent           455

Normally I count(PRIORITY) but this time I need to count how many TICKET fall in the range indicated TEMPO TRASCORSO having priority Low or normal or urgent

Any suggest?

14 Replies
sunny_talwar

Are you looking for or condition?

count({<PRIORITY = {'Low'}>+<TEMPOTRASCORSO = {'>=0<=24'}>} [TICKET])

count({<PRIORITY = {'Low'}>+<TEMPOTRASCORSO = {'>=25<=50'}>} [TICKET])

count({<PRIORITY = {'Low'}>+<TEMPOTRASCORSO = {'>=51<=100'}>} [TICKET])

Or this?

count({<PRIORITY = {'Low'}, TEMPOTRASCORSO = {'>=0<=24'}>} [TICKET])

count({<PRIORITY = {'Low'}, TEMPOTRASCORSO = {'>=25<=50'}>} [TICKET])

count({<PRIORITY = {'Low'}, TEMPOTRASCORSO = {'>=51<=100'}>} [TICKET])

fmazzarelli
Partner - Creator III
Partner - Creator III
Author

Hi,

i'm looking for.

No, it doesn't work.

The field TEMPOTRASCORSO is a calculated field

LOAD

.....

DTDELTA

.......

num(SubField((DTDELTA),' ',1))*24 + num(SubField(SubField((DTDELTA),' ',2),':',1))  AS TEMPOTRASCORSO";

;

and DTDELTA

contains 2 03:01 ................ 2 days 03 hours 01 minute

shraddha_g
Partner - Master III
Partner - Master III

TEMPOTRASCORSO is calculated on front end under Master measure or in Load script?

fmazzarelli
Partner - Creator III
Partner - Creator III
Author

Hi

in load script

vinieme12
Champion III
Champion III

TRY

count({< [TICKET] = {"=PRIORITY = 'Low' or (TEMPOTRASCORSO >=0 AND TEMPOTRASCORSO <=24)"}>} [TICKET])

count({< [TICKET] = {"=PRIORITY = 'Low' or (TEMPOTRASCORSO >=25 AND TEMPOTRASCORSO <=50)"}>} [TICKET])

count({< [TICKET] = {"=PRIORITY = 'Low' or (TEMPOTRASCORSO >=51 AND TEMPOTRASCORSO <=100)"}>} [TICKET])

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
fmazzarelli
Partner - Creator III
Partner - Creator III
Author

Hi,

TempoTrascorso: 49 (hours)

DTDELTA: 02 01:05 (2 days 05 hours 01 minute ...... 24 h + 24 h + 1 = 49 hours

Entro 4h .......

Formula;

count({< [PROGRESSIVO SEGNALAZIONI] = {"=PRIORITY = 'Low' AND (TempoTrascorso >=0 AND TempoTrascorso <=4)"}>} [PROGRESSIVO SEGNALAZIONI])

The value 1 should be placed in the column 'Oltre 8' h and not 'Entro 4h'

Where might be the error?

Immagine.png

sunny_talwar

Try this:

Count({< [PROGRESSIVO SEGNALAZIONI] = {"=PRIORITY = 'Low' AND (TempoTrascorso >= 0 and TempoTrascorso <=4/24)"}>} [PROGRESSIVO SEGNALAZIONI])

Since your TempoTrascorso is time field, it is in decimals which is why when you compare it to integers, most of them fall under 0 and 4 (unless something is greater than 4 days. If you are checking if TempoTrascorso is between 0 hours and 4 hours, try dividing these numbers by total number of hours in the day (which is 24) to get them hour equivalent.

fmazzarelli
Partner - Creator III
Partner - Creator III
Author

Hi,

the designation is claimed in fact "by" is counted up to 96 96/24 = 4 equivalent but the solution does not give the correct results.

Formula used is:

Count({< [PROGRESSIVO SEGNALAZIONI] = {"=PRIORITY = 'Low' AND (TempoTrascorso >= 0 and TempoTrascorso <=4/24)"}>} [PROGRESSIVO SEGNALAZIONI])Immagine.png

sunny_talwar

How about this?

Count({< [PROGRESSIVO SEGNALAZIONI] = {"=PRIORITY = 'Low' AND (DELTA >= 0 and DELTA <=4/24)"}>} [PROGRESSIVO SEGNALAZIONI])