cancel
Showing results for 
Search instead for 
Did you mean: 

Counting rows

Former Member
0 Kudos

I have created a query that generates a certain number of customers based on their sales volume. I would like to create a variable that would count the number of customers that are returned from this query. Can anyone give me some help?

Thanks

Brian

Accepted Solutions (1)

Accepted Solutions (1)

former_member188325
Active Contributor
0 Kudos

Hi Brian,

can u give me u r Query structure?what r u having in rows and columns?do u have any structures?y i am asking is,i had similar kind of requirement and by using formulas,properties of kf and chars...we solved it...

regards

Former Member
0 Kudos

My rows are just customers. My columns are '04 and '05 sales, plus the variance. I would like to have a fourth column that counts the number of customers (rows). I am filtering for certain customers based on the variance and I want to know how many I am getting.

Thanks

Brian

former_member188325
Active Contributor
0 Kudos

Hi Brain,

How u r filtering customers based on variance? like...if varince is > or < particular value?

for example in u r filtering customers if variance is > 0.then create a new formula ( 'Variance' >= 0 ).and set calculate result as Summmation.It displays total no of customers whose variance is >0...and set Suppress result rows 'never' for Customer.

Hope this helps

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Brian, Create a counter KF and write a conditions in the update rules based on your requirements and then try to create a variable.

regs,

MBA

edwin_harpino
Active Contributor
0 Kudos

hi Brian,

take a look this 'how to count the occurence...' doc hope it helps.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7e58e690-0201-0010-fd85-a2f...

former_member188975
Active Contributor
0 Kudos

Hi Brian,

If you have a Counter key figure in your InfoProvider, you can use this in the query definition. In its properties Suppress the Single values and Calculate Results as Summation. This should work for simple scenarios...what else do you have in your query definition?

Former Member
0 Kudos

Bhanu,

I do not have a counter field in my key figures. I am not an admin so I'm not sure if I can create this field. Assuming I can't, can you think of another option.

The query is very simple. Just a few other figures and dimensions.

Thanks

Brian

former_member188975
Active Contributor
0 Kudos

Hi Brian,

You could try doing the same by creating a formula = 1. If you just have Customer in drilldown, it will work fine. If you add another char, then since there will be 1 for each row, it will not give you the number of customers.

Hope this helps...