Showing posts with label customer. Show all posts
Showing posts with label customer. Show all posts

Friday, March 30, 2012

If my cube don't have a measure how do I design cube ?

suggest I will try to design customer complaint system

to keep information about customer's complaint it will store ex. department , date , complainant , complaint message

I can't figure out which column will be measure

Anyone can guide me about cube that don't have a measure

Thanks for kindness

You can create a "count" measure which simply counts fact table rows, so no particular fact table column is selected for such a measure, For example, if you select "Count of rows" for Usage in the dialog box below, and select the Source table, then Source column selection will be disabled.

http://msdn2.microsoft.com/en-us/library/ms187698.aspx

>>

SQL Server 2005 Books Online

New Measure Dialog Box (SSAS)

...

Usage

Select the aggregation function to be used by the new measure.

Source table

Select the table from which the new measure is to be created.

Source column

Select the column in the table selected in Source table on which the new measure is to be based.

>>

Monday, March 26, 2012

IF Command

Hi All,

I am having a few problems writing a sp for the sales team, I have to display a target figure from a customer dates

start_date target_year1 target_year2 target_year3 target_year4 target_year5 01/01/2004 100 150 120 150 170 01/01/2003 90 20 30 30 30

the start date for each customer is different so the target year 1 ,2 ect will be different time periods.

i need to display the start_date and the target year which relates to todays date:

so no 1 would be year 3 and no2 will be year 4.

any help would be much needed!!

rich

Hi,

To do this you can use case statements.

try this:

select startdate, case datediff(yy, startdate, getdate())

when 0 then targetyear1

when 1 then targetyear 2

.

.

etc

from yourtable

Regards

|||thanks for your help, worked a treat!|||

JMattias

sorry the example was not very good the month my change,

so I would change the yy for month...the next problem is in the selecting between months

select startdate, case datediff(mm, startdate, getdate())

when <12 then targetyear1

when >= 12 and < 24 then targetyear 2

ect..

But this does not work ......

|||

use the datediff statement in every when

Like this

select startdate, case when datediff...... then when datediff..... then etc

Regards

|||thanks ...now that did do the job!!|||Good, I'm glad to help!