Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have below expression :
Count({$<Req_state={3}>}Req_number). However I want to add one more condition that is Closed Date = null.
I am using below script but it is not working.
Count({$<closed_at = {NULL},Req_state={3}>}Req_number)
Could you please help me.
Thanks,
Sarif
Hi
Please try something like this,
Count({$<closed_at -= {'*'},Req_state={3}>}Req_number)
Regards
Harish
The above wont work. Try something like,
Count({$<Req_state={3}>}Req_number) - Count({$<closed_at -= {"len(trim(closed_at))=0"},Req_state={3}>}Req_number)
Regards
Harish
Hi Harish,
Both Expressions are not working... please suggest any other approach.
Thanks in advance,
Sarif
Have a look at
Excluding values in Set Analysis
Set analysis is depending on your sets (i.e. your data model and data), but maybe try something like this if Req_number is like a unique id field:
Count({$<Req_number = e( {< closed_at = {"*"} >} ), Req_state={3}>}Req_number)
Null values in a certain cannot be selected - not by inclusion, and not by exclusion (AFAIK).
The trick is to select values in another field that are associated with the NULL values in your field.
For example, the following three versions won't work:
closed_at = {NULL},
closed_at -= {'*'},
closed_at = {"=len(trim(closed_at))=0"}
while the following should return the desired:
Count({$<Req_number -= {"len(trim(closed_at))=0"},Req_state={3}>}Req_number)
In this expression, you are selecting (or rather excluding) Req_Number values that are associated with the NULL values in closed_at.
cheers,
Oleg Troyansky
Learn advanced QlikView and Qlik Sense techniques in my book QlikView Your Business.
Do we need to create any field called Req_number? If yes then what would be the expression?
Please suggest.
Thanks
Sarif
Hi Mohammad,
Req number is the field you used in your original formula:
Count({$<closed_at = {NULL},Req_state={3}>}Req_number)
There is no need in creating new fields. The point is that instead of selecting NULL values in the field closed_at, you should be selecting values of another field that is associated with closed_at.
hope it helps,
Oleg Troyansky
Hi Mohammad,
requesting you to use following for adding null values of closed_at field.
Count({$<closed_at = {"=Len(City)=0"},Req_state={3}>}Req_number)
Thanks,
Hi Mohammad,
just correcting my above expression,requesting you to use following for adding null values of closed_at field.
Count({$<closed_at = {"=Len(closed_at)=0"},Req_state={3}>}Req_number)
Thanks,