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

Counting of non negative Values

Hi Team,

Please refer below details i need the help to count only positive value excluding 0. in total i need to need count of if can anybody help me on this.

 

 

Distributor Name Sub Dealer Name YTD-2024 label_1
A AA 1 1
B AA -1 0
C Bc 2 2
D BD -1 1
E SD -1 1
F FE -1 1
Total   -1 6
17 Replies
stou
Contributor III
Contributor III
Author

@Anil_Babu_Samineni Sum(If(Year(smonth)='2024',Sale)) this expression which i have used to calculate measure.

im trying using count but still it showing the count for number 2 as 2 only i need to count if wherever the numbers >1 should be count as 1 only.

Anil_Babu_Samineni

@stou In general such operations, I recommend to use in script and the same flags can leverage into Set analysis. Anyway, for now I guess this might work. If this is not working, Do you have sample test file to check for the same?

Count(Aggr(Sum(If(Year(smonth)='2024',Sale))>0, [Distributor Name]))

And then, check the box suppress null value in data handling section from properties of the object in case you just want to show only that is >0.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
stou
Contributor III
Contributor III
Author

@Anil_Babu_Samineni  no its not working can you write the script function for that.

BrunPierre
Partner - Master
Partner - Master

@stou How about this?

=Count({$<[YTD-2024] = {">0"}>} [YTD-2024])

Anil_Babu_Samineni

@stou I appreciate if you can share sample QVF to test with both cases.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
stou
Contributor III
Contributor III
Author

@Anil_Babu_Samineni sorry but im unable to share it

PrashantSangle

try below

 

Sum(Aggr(if(Sum(If(Year(smonth)='2024',Sale))>0,1,0),Distributor_Name,Sub_Dealer_Name))

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
stou
Contributor III
Contributor III
Author

Thanks @PrashantSangle its work fine