SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


calcualte average by flag value in dimensions


calcualte average by flag value in dimensions

Author
Message
SQLKiller
SQLKiller
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 446
Hello Everyone,
I am trying to find the average sales by day if the flag value in dimension is Y or N. I am able to do it without Y or N and its working fine. But i dont know how to get average when flag value(whichis in flag_dimension). Here is my data model is attached.


The overallAvg below column i found it by a calculated member by followign 3 steps.
1. Find sum of price measures
2. Find the count
3. Sum/count and this gave me exact result.

But what if i want to find average only if FlagA is Y and average when FlagA is Y and flagB is Y/N.

Any help will be greatly appreciated.

Thanks
Attachments
Datamodel.png (7 views, 133.00 KB)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search