Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
moteb_marei
Contributor II
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())

govdisabled
SY02yes
SY03no
2 Solutions

Accepted Solutions
sunny_talwar

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

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

View solution in original post

undergrinder
Specialist II
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.

View solution in original post

6 Replies
sunny_talwar

May be this

Count({<gov = {"SY02"}, disabled = {"yes"}>} gov)
undergrinder
Specialist II
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.

 

 

 

moteb_marei
Contributor II
Contributor II
Author

thanks for your help,

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

 

pablolabbe
Luminary Alumni
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

sunny_talwar

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

Count({<gov = {"SY02"}, disabled = {"yes"}>} gov)
undergrinder
Specialist II
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.