Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, How to get the below data as is the Qlikview table and also in the nPrinting.
Desc | Sales1 | Sales2 | Sales3 |
---|---|---|---|
Prod A | 2 | 3 | 4 |
subprodB1 | 1 | 1 | 1 |
subprodB2 | 2 | 2 | 2 |
Prod B | 3 | 3 | 3 |
subprodC1 | 3 | 4 | 5 |
subprodC11 | 2 | 7 | 1 |
Prod C | 5 | 11 | 6 |
prod D | 2 | 4 | 6 |
Please refer the attached QVW
!
Dimension
=if(Indent='Yes',repeat(chr(9),4)&HeaderName,HeaderName)
LOAD SCRIPT:
ProdTable:
LOAD HeaderName,
cat1,
cat2,
cat3
FROM
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
LOAD * INLINE [
HeaderName,Indent,SortOrder
ABC,No,1
CDE,Yes,2
Desc1,Yes,3
LMN,No,4
OPQ,Yes,5
RST,Yes,6
Desc2,Yes,7
];
Using Indent Mode on a pivot chart will give you a result as below
Is it possible to get the indent in the same column?
Is the Product and SubProduct name in the same field?
Then add calculated dimension a below,but you will need an identifier between product and subproduct as we are only adding extra space in the beginning.
Let's assume Prodtype is the identifier for prod and subprod
=if(Prodtype = 'Prod', productname, ' ' & productname).
But this will not allow you to sort your table by productname
Yes, i have all the fields in single column. Below is the sample data.
HeaderName | cat1 | cat2 | cat3 |
ABC | 1 | 2 | 3 |
CDE | 1 | 1 | 1 |
Desc1 | 2 | 3 | 4 |
LMN | 2 | 3 | 3 |
OPQ | 2 | 2 | 2 |
RST | 1 | 1 | 1 |
Desc2 | 5 | 6 | 5 |
I did't get your expression. Could you please elaborate.
thank you
Please refer the attached QVW
!
Dimension
=if(Indent='Yes',repeat(chr(9),4)&HeaderName,HeaderName)
LOAD SCRIPT:
ProdTable:
LOAD HeaderName,
cat1,
cat2,
cat3
FROM
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
LOAD * INLINE [
HeaderName,Indent,SortOrder
ABC,No,1
CDE,Yes,2
Desc1,Yes,3
LMN,No,4
OPQ,Yes,5
RST,Yes,6
Desc2,Yes,7
];
Hi Vineeth,
Thanks, it is fine now. what if i have one more level indent availalbe in the source. In the above picture you have posted suppose CDE row has one more level of indent, how to get this done.
It goes like this.
ABC
CDE
Desc1
XYZ
Regards,
Viresh
Assign the number of times you want to add a space in the beginning to each product as below
ProdTable:
LOAD HeaderName,
cat1,
cat2,
cat3
FROM
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
LOAD * INLINE [
HeaderName,IndentLevel,SortOrder
ABC,0,1
CDE,4,2
Desc1,4,3
CDE,10,4
XXX,10,5
LMN,0,6
OPQ,4,7
RST,4,8
Desc2,10,9
];
Dimension: =repeat(chr(9),IndentLevel)&HeaderName
Hi Vineeth,
I am giving sort order in the ascnding order beginning from 1 but still i am not able to sort the values in my Header column. Am i missing something? Please let me know.
Regards,
Viresh