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

SQL Query Aggregate Error
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?

Categories

HOME
gcc
msbuild
salesforce
webvr
highmaps
jquery-plugins
azure-resource-manager
singleton
ms-application-insights
localhost
country-codes
ionic-native
software-collections
kairosdb
solidity
http-status-codes
oxid
comma
opengrok
repeater
openscad
amazon-data-pipeline
openam
caldav
udeploy
descriptor
datazen-server
onclicklistener
ppp
android-6.0-marshmallow
angular2-changedetection
bytebuffer
pushpad
apm
jboss-arquillian
wercker
imageprocessor
headphones
leaderboard
redhat-brms
word-wrap
instances
mockserver
fisheye
aspnetboilerplate
uitextview
colorbox
amazon-rds-aurora
wufoo
bootstrap-carousel
piranha-cms
weld
jenkins-2
geminabox
blackberry
nls
android-music-player
change-password
hotkeys
php-java-bridge
radar-chart
bbedit
calc
code-translation
alchemy
std
yfiles
xml-simple
euro
vspackage
android-networking
fileinputstream
dockerpy
report-builder2.0
ant-contrib
webshim
satisfiability
jsmpp
sqldatasource
starling-framework
lastinsertid
grunt-contrib-imagemin
source-depot
latex-suite
auctex
setcookie
sup
hwnd
cryptolicensing
xcdatamodel
large-data-volumes
uccapi
file-storage

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