Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
What is cross table? Where it can be used?
Thanks,
Attitude
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
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?
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.
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
Nice and simple...Thnx
Very useful!
Thank you