Single category view and hierarchy

If a document A depends on document B, then A.ancestor have a value: B \ A

If another document C depends on document B, C.Ancestor have the value: B \ C

Now, If document B is made child of document X then B.Ancestor=X\B

A.Ancestor=X\B\A

C.Ancestor=X\B\C

I do it with recursive function.

Now I want to show in each document they childs in a single category view (embedded)

But I don’t know how?

I try using @left(ancestor;“\”) in de first column and doc.name in show single category formula. But doesn’t work correctly for example for B document.

Please, I need some help. SORRY FOR MY ENGLISH

Guillermo

Subject: RE: Single category view and hierarchy

If Ancestors of a document contains Y, then the children of that document will contain Y\something. But because Y may contain a , it cannot be a category. You must create a categorized view that contains and Ancestors value with the \something taken out, and every \ changed to something else. E.g.

Column formula:

@ReplaceSubstring(@LeftBack(Ancestors; “\”); “\”; “:”)

Then in the “single category” formula of the embedded view, you could write @ReplaceSubstring(Ancestors; “\”; “:”)

Subject: RE: Single category view and hierarchy

Andre, thank you very very much.let me describe you some design elements of my application:

form: expte

fields:

  • Code: text (the document code)

  • Father: text

  • Hierarchy: text

Examples:


Code: 003

Father: 002

hierarchy: 001\002\003


Code: 004

Father: 002

hierarchy: 001\002\004


Code: 002

Father: 001

hierarchy: 001\002


Code: 001

Father: “”

hierarchy: “”


I need an embedded view in each document, where I can see childs documents hierarchycally organizated.

I try this:

column 1: @Explode(hierarchy;“\”), Categorized

column 2: @LeftBack(hierarchy;“\”), Categorized.

The result is almost good now. I would prefer for instance that in document 002 does not appear in itself but the following documents could be seen or another example . that in document number 003 does not appear anything in an embedded view

Thank you in advance

Subject: RE: Single category view and hierarchy

I need an embedded view in each document, where I can see child’s documents hierarchically organized.

Do you really mean the “child” documents, or do you want all descendants? E.g. from 001 should the view show only 002, or 003 and 004 also?

column 1: @Explode(hierarchy;“\”), Categorized

column 2: @LeftBack(hierarchy;“\”), Categorized.

I assume the selection formula for the embedded view is Code?

I see a potential problem here if the value Code is not unique. Could there be two documents with the same Code value?

The result is almost good now. I would prefer for instance that in document 002 does not appear in itself

You want that the embedded view in document 002 should not show document 002. It should contain only those documents that appear below 002 in the hierarchy.

In that case, column 1 should be the one to use the formula @LeftBack(hierarchy;“\”), so that a document will not appear in its own view.

Subject: RE: Single category view and hierarchy

Thank you again Andre!

I need an embedded view in each document, where I can see child’s documents hierarchically organized.

Do you really mean the “child” documents, or do you want all descendants? E.g. from 001 should the view show only 002, or 003 and 004 also?

I want to see all descendants.

in document code 001 I want to see:

—002

------003

------004

column 1: @Explode(hierarchy;“\”), Categorized

column 2: @LeftBack(hierarchy;“\”), Categorized.

I assume the selection formula for the embedded view is Code?

Yes!

I see a potential problem here if the value Code is not unique. Could there be two documents with the same Code value?

No , it’s imposible, don’t worry about, this value is Primary Key

The result is almost good now. I would prefer for instance that in document 002 does not appear in itself

You want that the embedded view in document 002 should not show document 002. It should contain only those documents that appear below 002 in the hierarchy.

Yes!

in document code 002 I want to see:

—003

—004

In that case, column 1 should be the one to use the formula @LeftBack(hierarchy;“\”), so that a document will not appear in its own view.

Now I have the formula: @Explode(@leftback(Agregados;“\”);“\”) in column 1 and the result is

▼001

–▼002

------003 Document 003

------004 Dcoument 004

Subject: RE: Single category view and hierarchy

And is that what you want? If not, in what way do you want it to be different?

Subject: RE: Single category view and hierarchy

not exactly but… with my horible english I can’t say to you what exactly is that I want. Then

Don’t worry , with your simple @leftBak you help me much.

THANK YOU