Showing posts with label categories. Show all posts
Showing posts with label categories. Show all posts

Friday, March 23, 2012

How to create categories tree with subcategories ?

Hi, I Have 2 tables. First name of this tables is news_categories with one record: News. Strucutre this table ID and name_categories Second name of this tables is news_subkategorie with two records : With country and with world. Strucutre ID_Subcategories and name_subcategories I will receve effects:

News

--With country

--With world

How i write in Select Command ?

SELECT [ID_subcategries], [Name_subcategories], [ID] FROM [db_subcategories], [db_categories] WHERE (??)

How do you connect categories and subcategories? Does db_subcategories have ID which says to which category that subcategory belongs?

If that is true, than:

SELECT db_categories.ID, [ID_subcategries], [Name_subcategories]FROM [db_subcategories], [db_categories]WHERE db_categories.ID = db_subcategories.IDOrder By 1Asc, 2Asc
|||

Hi,

this is my conncetion in web.config:

<

connectionStrings>

<

addname="ConnectionString"connectionString="Data Source=FS_AMILO_2065;Initial Catalog=sklep.mdf;Integrated Security=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

I have in categories.aspx GridView I link to subcategories.asp

subcategories?id={0}

|||

You can use modification of above query to return all subcategories for given ID:

SELECT [ID_subcategries], [Name_subcategories]FROM [db_subcategories]WHERE db_subcategories.ID = @.catIDOrder By 1Asc, 2Asc

where you use @.catID to store supplied ID

|||

ID is a ID from categories ?

I mustMust declare the scalar variable "@.ID".

So i go to Pramters and ID is a QuertyString and ??

sql

How to create categories tree with subcategories ?

Hi, I Have 2 tables. First name of this tables is news_categories with one record: News. Strucutre this table ID and name_categories Second name of this tables is news_subkategorie with two records : With country and with world. Strucutre ID_Subcategories and name_subcategories I will receve effects:

News

--With country

--With world

How i write in Select Command ?

SELECT [ID_subcategries], [Name_subcategories], [ID] FROM [db_subcategories], [db_categories] WHERE (??)

That is not easy but the link below will take you in the right direction. Hope this helps.

http://www.yafla.com/papers/sqlhierarchies/sqlhierarchies.htm#Figure1

Friday, March 9, 2012

How to create a dimension for multi-value fields

Hi,

I'm new to SSAS and really confused... I'm creating a cube for "Accounts", each account can belong to N categories, I created a "bridge" table on my model where I say:

Account 1 - Category 2
Account 1 - Category 3
Account 2 - Category 2
....

I dont know how to use SSAS to use the bridge table accordingly so whenever I'm browsing the cube using DimCategory and another dimension, lets say DimTerritory I get a proper count. Can you tell me how should I proceed?

Thanks.

Hi,

take a look into Many-to-many dimensional modeling paper from Marko Russo.

It's really good stuff about problems like your one.