Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vireshkolagimat
Creator III
Creator III

Indent the rows

Hi, How to get the below data as is the Qlikview table and also in the nPrinting.

DescSales1Sales2Sales3
Prod A

2

34
      subprodB1111
      subprodB2222
Prod B333
     subprodC1345
          subprodC11271
Prod C5116
prod D246
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Please refer the attached QVW


indent.PNG !



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
]
;



Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

15 Replies
vinieme12
Champion III
Champion III

Using Indent Mode on a pivot chart will give you a result as below

indent.JPG

pivotIndent.JPG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vireshkolagimat
Creator III
Creator III
Author

Is it possible to get the indent in the same column?

vinieme12
Champion III
Champion III

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

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vireshkolagimat
Creator III
Creator III
Author

Yes, i have all the fields in single column. Below is the sample data.

  

HeaderNamecat1cat2cat3
    ABC123
    CDE111
Desc1234
    LMN233
    OPQ222
        RST111
Desc2565
vireshkolagimat
Creator III
Creator III
Author

I did't get your expression. Could you please elaborate.

thank you

vinieme12
Champion III
Champion III

Please refer the attached QVW


indent.PNG !



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
]
;



Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vireshkolagimat
Creator III
Creator III
Author

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

vinieme12
Champion III
Champion III

Assign the number of times you want to add a space in the beginning to each product as below

indent2.JPG

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

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vireshkolagimat
Creator III
Creator III
Author

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