Skip to Content
0

Count along with match function in Webi

Dec 20, 2016 at 02:13 AM

138

avatar image

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,

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Vishal P Dec 20, 2016 at 02:17 AM
0

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!


Share
10 |10000 characters needed characters left characters exceeded
Venkatesh Katta Dec 20, 2016 at 09:48 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Kuldeep Ghosh Dec 20, 2016 at 09:55 AM
0

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

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Kuldeep,

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

Thanks,

0
Kuldeep Ghosh Dec 20, 2016 at 11:52 AM
0

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])


sample.jpg (76.2 kB)
Share
10 |10000 characters needed characters left characters exceeded
Vishal P Dec 26, 2016 at 08:50 AM
0

Thank you Kuldeep, is working fine.

Share
10 |10000 characters needed characters left characters exceeded