Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2801

Re: To Divide Two Counts (total count, count with filter) in hana view from same table

$
0
0

Hello Swathi,

 

Not quite sure whether I understand your requirement correctly, but I just played around. What I understood is, you have a table or a view where you need to fetch the count of a column based on filter and without filter. Below is the test table I created

table content.png

In the table column a has 5 records in it. See the CV image below

 

cv.png

How I created the CV is,

 

1. Create the CV with data category Dimension

2. Add an aggregation node and place the table, then add the count as aggregated column

3. Add a projection node and place the table, then add the column which you want the count to output column. Create you filter expression with input parameter here.

4. Add an aggregation node and point the above created projection node here. Now add the count as an aggregated column.

5. Add an Union node and point the two aggregation nodes here, add the output column

6. Point the Union node to main projection node,add the output column and activate your view.

 

In my test table I have 4 records with value 100 and total record count is 5. See the output below

 

output.png

 

Regards,

Nithin


Viewing all articles
Browse latest Browse all 2801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>