cancel
Showing results for 
Search instead for 
Did you mean: 

Count along with match function in Webi

vishal_p3
Participant
0 Kudos

Hello Experts,
I have the below table in webi

and require the "count of occurance of IMP at the beginning of the Description field for each product", I should extract the below table.

I have tried using the variable "=Count(Match([Description]; "IMP*")) In ([Product])" but not as expected. Please help!

Thanks,

Accepted Solutions (0)

Answers (5)

Answers (5)

vishal_p3
Participant
0 Kudos

Thank you Kuldeep, is working fine.

former_member198519
Active Contributor
0 Kudos

I tried and it is working for me:

[IMP Match]= Sum(Match([Description];"IMP*")) In ([Product])

[IMP No Match] =Sum(If(Match([Description];"IMP*")=0) Then 1 Else 0) In ([Product])

former_member198519
Active Contributor
0 Kudos

Your logic should work. Just instead of count use Sum(). See if that helps.

=Sum(Match([Description]; "IMP*")) In ([Product])

vishal_p3
Participant
0 Kudos

Hi Kuldeep,

I am not getting the desired output by using the above formula.

Thanks,

Former Member
0 Kudos

Hello Vishal

I guess, Count cannot be used over Match since it returns Boolean value. I tried like below .

1. Imp-Matching= Match([Desc];"IMP*") It returning 1's & 0's.

2. Create variable which converts the above variable to Number using Tonumber function; Imp-Match-Meas = ToNumber([Imp-Matching])

3. count the matching using variable with = sum([Imp-Match-Meas]) foreach ([Product]).

similarly use "Not" function in first variable to achieve non matching count.

Hope it helps

Regards

Venkatesh

vishal_p3
Participant
0 Kudos

Re submitting the query as the tables were not clear

Hello Experts,
I have the below table in webi

and require the "count of occurance of IMP at the beginning of the Description field for each product", I should extract the below table.

I have tried using the variable "=Count(Match([Description]; "IMP*")) In ([Product])" but not as expected. Please help!