Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
can we use the select result from tab as the columns name for straight table.
For example , I has one table in Database like the below
ID | Name |
---|---|
1 | A |
2 | B |
3 | C |
when I create straight table , i want use A,B,C as the columns name, as the table value is dynamic,so i can't set the value fix, so i want to use the select in the script and make the result as the column name, can we do that?
Hi,
You can drag the the field which contains A,B and C to as top header. So that each value will be represented as column in pivot table.
And depends on your selection number of columns will be dynamically change.
For Straight table use "generic" load to display the column value as columns.
Generic Load is the complement of "Crosstable Load". In a loose sense, you could say that a Crosstable Load creates a Generic table and Generic Load creates a Cross table.
BR ,
Chinna
Hi,
This doesn't works in Straight table, because in straight you are not able to pivot the dimension/expression, you have to separate separate expression for each value.
Why you are not looking for Pivot table, since it is very easier to achieve using it.
Regards,
Jagan.
for making row to column once can try using cross table concept.
Zhang ,
Yes go with pivot table .
A cross table is a common type of table featuring a matrix of values between two orthogonal lists of header data. It could look like the table below:
Example:
Year | Jan | Feb | Mar | Apr | May |
1991 | 45 | 65 | 78 | 12 | 78 |
1992 | 11 | 23 | 22 | 22 | 45 |
1993 | 65 | 56 | 22 | 79 | 12 |
1994 | 65 | 24 | 32 | 78 | 55 |
1995 | 45 | 56 | 35 | 78 | 68 |
If this table is simply loaded into QlikView, the result will be one field for Year and one field for each of the months. This is generally not what you would like to have. One would probably prefer to have three fields generated, one for each header category (Year and Month) and one for the data values inside the matrix.
This can be achieved by adding the crosstable prefix to your load or select statement.The statement for loading this cross table could be:
crosstable (Month, Sales) load * from a.csv;
The result in QlikView would be as follows:
Year | Month | Sales |
1991 | Jan | 45 |
1992 | Feb | 11 |
1993 | Mar | 65 |
1994 | Apr | 65 |
1995 | May | 65 |
23 | ||
56 | ||
24 |
Thanks,
AS
hi
thanks for your reply,
i think may be there is some mistake, as i want if i has one table like below
ID | Name |
---|---|
1 | A |
2 | B |
3 | C |
in the qlikview i want to show one table like the below with the script select name from table
ID | A | B | C |
---|---|---|---|
1001 | 1 | 2 | 3 |
2002 | 4 | 5 | 6 |
2003 | 7 | 8 | 9 |
Just drag your name table to right hand side if you have pivot table , it will work exactly the way you want.
Thanks,
AS