Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What is cross table? Where it can be used?

Hi All,

What is cross table? Where it can be used?

Thanks,

Attitude

6 Replies
Not applicable
Author

Hi,

Are you referring to Crosstable with cross tab.

Cross tables are table where facts are divided on the basis of dimension values.

for example we have sales for every month. then, if in our database we load sales amounts as a separated field for every month as

Product         Jan                    Feb                    Mar   etc

a                    100                    200                    300

So, basically we have 1 single fact as sales amount here, and jan-dec are dimension memebers of month dimension but we are creating different fields for every dimension member and treating them as different field.

Loading data this way, makes it difficult to properly aggregrate the data over different dimensions and difficult to do analysis.

So, we convert this crosstable into a normal table.

using

crosstable (Month, Amount)

load

*

from a.qvd(qvd);

then we will get the same table as

Product     Month     Amount

a                    jan          100

a                    feb          200

a                    mar          300

I hope you understand now, what is crosstable. let me know if it solves your concern.

Regards,

Ashutosh

Not applicable
Author

I'm having trouble with this and your explanation doesn't make sense to me.

I have data being loaded from a SQL datasource, specificially a stored procedure.  I need to move the date field from rows to columns.  How do I do this?

Not applicable
Author

Hi,

Sorry for the late reply.

Can you just give us a sample of your exact requirement.

To do reverse of Crosstable, you can use generic load which will give you a crosstable from a straight table.

Miguel_Angel_Baeyens

Hi,

Ashutosh example is good enough, and quite a frequent example on how to use a crosstable load. Check anyway the attached application here for further reference.

Regards.

Miguel

Not applicable
Author

Nice and simple...Thnx

Anonymous
Not applicable
Author

Very useful!

Thank you