Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datediff problem

Status
Not open for further replies.

sekar211

MIS
Dec 15, 2003
55
US
I have two columns Startdate and enddate and i need one more column (startdate-enddate).

I am using a metric for totaldays applysimple("datediff(d,#0,#1)",startdate,enddate)

But when i validate ,it says object of type 'startdate' is not allowed!

if any one know how to do this please let me know.

Thank you.


 
Two issues:

Metrics must be built from facts or attributes, since only these objects have a fact entry level. Metrics perform aggregations, which requires a starting level. That's why columns aren't allowed; if you recall, facts consist of fact expressions that contain both columns and logical table mappings. Using a column doesn't tell MSTR what tables you're allowed to use, which doesn't tell MSTR what level the column is at.

Also, since metrics perform aggregations, you need an aggregation function. To do passthru SQL, use ApplyAgg instead of ApplySimple. ApplyAgg has a aggregation component, where you can define dimensionality, etc. This is required for metrics.

Hope this helps.
 
you could try
applysimple("datediff(d, #0,#1)" , msx(startdate), max(enddate) )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top