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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewwizard
Master II
Master II

Count function

Hi All,

What is the meaning of the below expression?

Count({<[ON/OFF Pathway]={'OFF'} >} Distinct HSP_ACCOUNT_ID), 0)

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

HI,

I think you missed some part of the expression in the beginning, I guess it would be either If() or Alt().  The above expression counts the Distinct HSP_ACCOUNT_ID which is having ON/OFF Pathway as {'OFF'}.

Hope this helps you.

Regards,

Jagan.

View solution in original post

7 Replies
sunny_talwar

I think you have a additional (,0)) thing at the end which may be part if statement. But this part (Count({<[ON/OFF Pathway]={'OFF'} >} Distinct HSP_ACCOUNT_ID)) means that you are distinctly counting HSP_ACCOUNT_ID where [ON/OFF Pathway] is OFF

HTH

Best,

Sunny

qlikviewwizard
Master II
Master II
Author

Hi sunindia

Thank you for your reply. Yes, I confused with ,0. 

sunny_talwar

Ya I think this expression by itself with ,0) at the end will give you an error.

Kushal_Chawda

assuming you have expression

alt(Count({<[ON/OFF Pathway]={'OFF'} >} Distinct HSP_ACCOUNT_ID), 0)



First - You are counting the distinct values of HSP_ACCOUNT_ID associated with [ON/OFF Pathway] where value is 'OFF'.

If there is no values of HSP_ACCOUNT_ID associated with [ON/OFF Pathway] alt function returns zero

qlikviewwizard
Master II
Master II
Author

Kush141087


I am also guessing the same. But it look like if function. But actually not.

jagan
Partner - Champion III
Partner - Champion III

HI,

I think you missed some part of the expression in the beginning, I guess it would be either If() or Alt().  The above expression counts the Distinct HSP_ACCOUNT_ID which is having ON/OFF Pathway as {'OFF'}.

Hope this helps you.

Regards,

Jagan.

qlikviewwizard
Master II
Master II
Author

Hi jagan,Kush141087,

Actual expression was this. It was my mistake not seen keen.

Thank you for your answers.

=If(Getpossiblecount([ON/OFF Pathway])>1 OR [ON/OFF Pathway]='OFF', Count({<[ON/OFF Pathway]={'OFF'} >} Distinct HSP_ACCOUNT_ID), 0)