Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8735

Tricky query req for count - inputs pls

$
0
0

Hello,

 

My cube has following data

 

Order noOrder typeSpecial orderNet ValueOrder date
1000B1Y200010.11.2014
1000B2Y-250012.11.2014
1001B1Y300011.11.2014
1001B2Y-350013.11.2014
1001B2Y-500012.11.2014
1000B1Y-400011.11.2014

 

For all special orders and within specified range of order date (Input in query), total count of orders need to be calculated based on sum of net values for each order type and per order. If Netvalue <0, count order as -1 and if Net value >0, count it as 1.

 

Input Range:  10.11.2014 to 12.11.2014

Output should be

 

Order typeOrder count
B10
B2-2

 

For this range, B1 got 2 orders ideally. For order 1000, count is -1 and for order 1001, count is 1 and hence total count is 0.

 

Can I do it in query designer? If so please suggest?


Viewing all articles
Browse latest Browse all 8735

Trending Articles



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