cancel
Showing results for 
Search instead for 
Did you mean: 

Count calcuation

Former Member
0 Kudos


Hi folks.

I am trying to use this count function to calculate number of lines within each PO but not getting the desired result. What is the best approach to this?

the fields are Vendor, PO, PO Line# ... using these I need to get the count of PO Line# at Vendor level.

sample data:

Vendor     PO     PO Line#

111           100     1

111           100     2

111           100     3

111           101     1

111            101     2

112            100     1

113            100     1

113            100     2

result should look like this:

Vendor     Count

111           5

112           1

113           2

Thanks for your help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this approach.

Former Member
0 Kudos

Great. I had tried a different approach earlier but this works like a charm.

I can't unfortunately have the WHERE condition working on this formula. Please can anyone help?

This portion works fine ...

Count([Order No]+[Line No] In ([Vendor])

But not when using the WHERE operator .. I color coded the () for better clarity.

Count([Order No]+[Line No] In ([Vendor]) Where ([Days Past Delivery Date] > 90))

Thanks!

Answers (1)

Answers (1)

Former Member
0 Kudos

v_Count = Count([PO]+""+[PO Line#])

Former Member
0 Kudos

hHi,

try Count([Vendor];All) in ([Vendor]),

CHeers,

ROgerio

Former Member
0 Kudos

Hi Prasanth,

" v_Count = Count([PO]+""+[PO Line#]) "  - I am not sure how that formula can work unless I am missing something. I am trying to count the number of lines within PO.

Former Member
0 Kudos

WIth the formula you will be counting all the ocurrences of Vendor for each Vendor, so for Vendor 111 there are 5 ocurrences and so on,

CHeers

Former Member
0 Kudos

Hi Rogerio,

Count([Vendor];All) in ([Vendor]) ... this is not working. Can you explain this formula though? I am understanding you are suggesting the count the vendors and ignoring all other dimensions. Is that right?

Former Member
0 Kudos

what's happening with the formula?

WHich is the output?

Former Member
0 Kudos

Well, from your example, I thought you want count on Vendor.

So if you just use count([PO Line#]) initially, what was actual issue, you said you are not getting desired result, Can you explain more ...

Former Member
0 Kudos

Nopes, it's not working. I am just getting the vendor count itself .. so for 111, I am getting 1 and so on.

Former Member
0 Kudos

I want to count "number of PO lines" but PO# does not appear on the output block so the result is not correct when using count ([PO Line#])