Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dripet
Contributor
Contributor

How to count a field

Hi,

I have set this variable:

Set ve_PHT = SUM({$<PHT = {'HT', 'DP'}>} #RecFar);

Now I want to make the count independently from the value that takes PHT. Because today it takes only two variables, but maybe in my next updates it can take other values. So I need to make it dynamically. 

I try these by they didn't work:

Set ve_PHT = SUM({$<PHT={"$(=LEN(PHT)>0)"}>} #RecFar);

Set ve_PHT = SUM({$<PHT={'*'}>} #RecFar);

Any suggestions on how can it be done? 

1 Solution

Accepted Solutions
Saravanan_Desingh

Use LET instead of SET and double quote. This is like PHT Is Not NULL.

Let ve_PHT = SUM({$<PHT={"*"}>} #RecFar);

 

View solution in original post

1 Reply
Saravanan_Desingh

Use LET instead of SET and double quote. This is like PHT Is Not NULL.

Let ve_PHT = SUM({$<PHT={"*"}>} #RecFar);