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

Excluding zero values in expression in Text Box

Hi Experts,

I am not able to find the solution to count only 1's values in an expression and to exclude the zero values in expression.

Please find the below example. expression as below

Counts2 = count({<Year={$(=vYearSel)},Quarter={$(=vQuarterSel)},Month={$(=vMonthSel)},MonthYear={$(=vMonthYear)},

OptRegion={'$(=vRegionSel)'},OptSubRegion={'$(=vSubRegionSel)'},OptCountry={'$(=vCountrySel)'},

ProductName={'$(=vMCCPprod)'},Segment={'$(=vsegment)'},OptType={'Opt_In_vod'},LinkDataSource={'M'}>}DISTINCT AccountID)

I wanna count the number's that are 1's in a table, but not zero in the table in "Out Counts" and "Count2" only. For few cases the it's working fine

       

OptCountryAccountIDContactSpecialityIDOpt In CountOpt_In%Out countsOut%count2
Total 97.6%102.4%10
Japan0019000001w114qAAAaCardiologyPH_HCP_4217100.0%1100.0%0
Japan0019000001f0IkaAAEbInternal MedicinePH_HCP_415001100.0%00.0%1
Japan0019000000KUMmIAAXcCardiologyPH_HCP_41291100.0%00.0%1
Japan0019000000KUM8CAAXdCardiologyPH_HCP_360471100.0%00.0%1
Japan0019000000LiV6vAAFeCardiologyPH_HCP_381091100.0%00.0%1
Japan0019000000KUNVXAA5fCardiologyPH_HCP_117661100.0%00.0%1
Japan0019000000KUMcMAAXgCardiologyPH_HCP_24241100.0%00.0%1
Japan0019000000NByo1AADhNeurologyPH_HCP_115911100.0%00.0%1
Japan0019000000KUMQNAA5iCardiologyPH_HCP_3461100.0%00.0%1
Japan0019000000KUNkJAAXJCardiologyPH_HCP_176171100.0%00.0%1

kindly help. Thanks.!

Rerags,

MR.

3 Replies
sibin_jacob
Creator III
Creator III

Hi,

Can you share the sample application?

Thanks,

Sibin

Anil_Babu_Samineni

How about this?

If(

count({<Year={$(=vYearSel)},Quarter={$(=vQuarterSel)},Month={$(=vMonthSel)},MonthYear={$(=vMonthYear)},

OptRegion={'$(=vRegionSel)'},OptSubRegion={'$(=vSubRegionSel)'},OptCountry={'$(=vCountrySel)'},

ProductName={'$(=vMCCPprod)'},Segment={'$(=vsegment)'},OptType={'Opt_In_vod'},LinkDataSource={'M'}>}DISTINCT AccountID)<>0,

count({<Year={$(=vYearSel)},Quarter={$(=vQuarterSel)},Month={$(=vMonthSel)},MonthYear={$(=vMonthYear)},

OptRegion={'$(=vRegionSel)'},OptSubRegion={'$(=vSubRegionSel)'},OptCountry={'$(=vCountrySel)'},

ProductName={'$(=vMCCPprod)'},Segment={'$(=vsegment)'},OptType={'Opt_In_vod'},LinkDataSource={'M'}>}DISTINCT AccountID))


Or

If(Column(1)<>0,Column(1))


Or

If(MeasureLabel<>0,MeasureLabel)

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
123qlik123
Contributor II
Contributor II
Author

Hi All,

Thanks for the reply.

I am not able to share the application, can you please suggest if my expression is giving any other errors.

Regards,
Ramana M