aggregate-functions


Subtract 2 measures as Grand Total in SSAS Cube Browser


I guess it's a common and basic issue. I'm trying to get the "net value" of a measure depending on a dimension. Let me explain..
I have a fact table factTicket and a dimension called Operation who have 2 values: Opened and Closed. The goal is to get the number of ticket opened and closed for each month.
In the Cube Browser, I have a Distinct Count Measure of the TicketID according to the Operation dimension, but I would like the Grand Total to be Opened minus Closed instead of Opened + Closed
The factTable has a record with the date for every opened ticket, and a second record is added when the ticket is closed (So a Ticket can only have a maximum of 2 records in the fact table)
Is it possible ? I can't find a way to do it.. Maybe the Operation Dimension is a bad idea and I should have 1 record per ticket, with an OpenedDate and ClosedDate field ? I don't believe it will fixe the probleme since Distinct Count always return positive value, so the Grand Total will still be Opened + Closed.
Any ideas is welcome !
Thx
The scope function is what I needed:
SCOPE([Dim Operation].[OpenClose].[All], [Measures].[TicketCount]);
THIS = [Dim Operation].[OpenClose].&[OPEN] - [Dim Operation].[OpenClose].&[CLOSE]
END SCOPE;

Related Links

Usage of aggregate functions in MarkLogic
Querying customDimensions in Google Bigquery
NHibernate - QueryOver criteria appearing in Where instead in Having clause, error
Howto aggregate on full data set in Spring Batch jobs?
Creating an aggregate function fails
Necessity of declaration of function in c and cpp
Calculate window average in tableau
Complexity asymptotic relation (theta, Big O, little o, Big Omega, little omega) between functions
What are TOP_COUNT and TOP_MAXCOUNT in BigQuery?
marklogic need advise for approach to aggregate documents
multiply(num) aggregate function in postgresql
Binding the Result of an Aggregate Function to a Projected Variable
tableau aggregate data based on dimension
where clause and aggregate functions
Is there such a thing as a join() aggregate function that concatentates field values at a specific character?
Aggregation of an expression in Django query spanning multiple tables

Categories

HOME
c#
twitter-bootstrap
swift3
sip
oracle-sqldeveloper
openacc
mysqli
microcontroller
bigtable
file-upload
conceptual
magento-1.9.2.1
swap
rethinkdb
software-collections
google-app-maker
spring-data-solr
apache-httpclient-4.x
dynamics-crm-2011
guidewire
ng2-charts
camunda
eclipse-orion
filehelpers
serenity-js
dev-c++
ng-tags-input
rvm
deployment-descriptor
sasl
adobe-captivate
dynamic-memory-allocation
ios9
jmsserializerbundle
flickr
ilog
voyager
offset
geocomplete
mkdir
ragel
gstreamer-1.0
kepserverex
client-server
mapquest
framebuffer
mediastream
keychain
tapply
autodesk-data-management
mtm
peerjs
pexpect
scrapinghub
react.rb
g77
stanford-nlp-server
runtime-permissions
openpgp.js
totalview
acceleo
addressbook
fileopendialog
firebase-polymer
scriptengine
nimbus
aws-kms
user-profile
razorengine
usps
jcalendar
firefox-os
oryx
nslocalizedstring
random-sample
exchange-server-2007
pushwoosh
roslyn-code-analysis
eggplant
firewire
data-representation
screen-lock
autopep8
perfect-scrollbar
mathics
xmla
unityvs
powerpoint-2010
switchpreference
farpoint-spread
logo-lang
thucydides
kendo-window
oc4j
wpd
stringstream
magicsuggest
correctness
android-memory
ios6-maps
winrt-async
pex-and-moles
openwrap
method-call
html5-animation
http-response-codes
xslt-grouping
mysql-logic
opengl-to-opengles
expander
j++

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App