Showing posts with label flattened. Show all posts
Showing posts with label flattened. Show all posts

Tuesday, March 20, 2012

"where" in DTS

i try use "where" to filter record for result but when i run , there is a message error task.

select flattened

(select * from predict ([model name].[table name], include_statistic) where [$support] >0 ) as ph

from

[model name]

prediction join

.....

can onebody help me?

What is the error?|||It could be that you need to say "INCLUDE_STATISTICS" rather than "INCLUDE_STATISTIC"|||

error that it messesage: " there an error occur in task". no more information to know what error and where error in query.

what's different between INCLUDE_STATSTICS and INCLUDE_STATSTIC?

|||

The difference is one is a keyword, and the other is an error.

You can try to execute your query in SQL Management Studio to see the full error message, although it should be available from SSIS as well.

If you are doing this on the pipeline and you want to validate your DMX syntax simply eliminate the PREDICTION JOIN clause,

e.g.

select flattened

(select * from predict ([model name].[table name], include_statisticS) where [$support] >0 ) as ph

from

[model name]

|||

sory, but first, i writed like that but still have error. and it didn't message with an clear error to know what error. how can i do now?

i try a model to show other products when someone choose a product. my result have many record that same.

e.g:

productid otherProductid

1 34

1 74

1 89

2 34

2 74

2 89

3 34

3 74

3 89

4 56

4 101

4 73

....

what wrong with my model and how i should do to my event?

thanks

|||

This is not an error, rather a feature. This occurs when your model doesn't contain rules for the data in your input. The system is designed that if you ask for 5 recommendations, you will get 5 recommendations. If the input you provide doesn't resolve into any rules (or enough rules) you will get the most popular results. I.e. it looks like item 34 is the most popular in your training set.

There are a few ways to alleviate this issue. One is to change the minimum_support and minimum_probabilty such that you generate more rules. Another is to filter results that are not based on rules. A description on how to do this is at http://blogs.msdn.com/jamiemac/archive/2006/04/19/579409.aspx

Thanks

Tuesday, March 6, 2012

"distinct" in select query

when i use select :

select flattened

(select productid, $support from [model name].[table] )......

i have result with many record same.

so i write :

select flattened

(select distinct productid, $support from [model name].[table] )......

but when i run, it's error. ( don't know what error).

how can i do to get table record with not same record (loop)

note : it write in DTS and i use sql 2000

I assume you mean an Analysis Services query.

Try: SELECT DISTINCT [model name].[table].[productid] FROM [model name]

This should return the distinct list of products

|||

i can't use query like you show.

i want you "distinct " in DTS syntax like that:

select flattened

(select productid, productname, categoryid ,[$probability] from predict([model name].[table name], incluse_statistics) where productid > 1000)

from [model name]

prediction join

shape{....}

appen{....}

on....

How can i put Distinct to have different record?

|||

You can't use DISTINCT in that context. However, I think what you want is to be able to discriminate the records by the user. In this case, the selection will return the product id at most once per input case, but since you don't include an external id, there's no way to discriminate which prediction is for which customer.

I think you need something like

SELECT FLATTENED t.CustomerID, (select ....

This query will return the id from the source data query along with the results of the prediction.