Announcements
cancel
Showing results for
Did you mean:
Contributor II

## countifs

Hi dears,

I am Trying to make countifs logic in qlik script, is there anybody has the idea???

I need this logic: countifs([gov]="SY02",[disabled]="yes",1,null())

 gov disabled SY02 yes SY03 no
2 Solutions

Accepted Solutions
MVP

Did you get a chance to try this as an expression?

`Count({<gov = {"SY02"}, disabled = {"yes"}>} gov)`
Specialist II
Just use @sunny_talwar solution's with set analysis:
=Count({<gov = {"SY02"}, disabled = {"yes"}>} gov)

Or I think my solution works at charts too.

G.
6 Replies
MVP

May be this

`Count({<gov = {"SY02"}, disabled = {"yes"}>} gov)`
Specialist II

Hi,

If you want to implement it in load script, then use the next statement:

```Load
columns1..N,
count(if(gov='SY02' and disabled='yes',1,null()) as countif
Resident [tablename]
group by columns1...N;```

If you need in charts, then use the solution from @sunny_talwar with set analysis.

G.

Contributor II
Author

but i need to add it in pie chart do you have any idea?

Luminary Alumni

Hi,

Please remember to post questions related to the product in the correct discussion board.

Here is the list of discussion board for qlik products,  https://community.qlik.com/t5/Qlik-Products/ct-p/qlik-products

This post will be moved to the correct discussion board soon.

Thanks, Pablo

MVP

Did you get a chance to try this as an expression?

`Count({<gov = {"SY02"}, disabled = {"yes"}>} gov)`
Specialist II
Just use @sunny_talwar solution's with set analysis:
=Count({<gov = {"SY02"}, disabled = {"yes"}>} gov)

Or I think my solution works at charts too.

G.