Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Relative object position

Hi,

I have two pivot tables, one below the other. The one above can be longer or shorter but I need the other keeps allways the same distance to the other.

How can I get so?

Thanks a lot.

8 Replies
khadeer
Specialist
Specialist

In Caption tab u have Xpos, YPos, height, Width.... Keep same for both.

Not applicable
Author

Sorry I made a horrible traslation, I meant I need to keep constant the distance between both tables, so the second one moves depending on the first one size.

er_mohit
Master II
Master II

i can not get you exactly..can you explain it with attached image?

Not applicable
Author

For example , I want the table 'EBITDA' situated one centimeter below the table 'RESULTADOS' no matter how many rows can 'RESULTADOS' have. Allways one centimeter below.

tables.png

marcus_sommer

I think this is only possible per macro. Read the size from table1 and set table2  x  pixels below. See the examples like below in APIGuide.qvw.

rem ** move all objects on active sheet 20 pixels down and 15 right **

set sh = ActiveDocument.ActiveSheet

for i = 0 to sh.NoOfSheetObjects-1

    set obj = sh.SheetObjects(i)

    pos = obj.GetRect

    pos.Top = pos.Top + 20

    pos.Left = pos.Left + 15

    obj.SetRect pos

next

Marcus

Not applicable
Author

Thank you very much but is too complicated for me.

Is very dissapointing that QV are not able to do something so simple using basic user tools.

Thanks Marcus

jburstin
Contributor
Contributor

Hi!

I had this issue too, and could resolve it with macro code bellow.

This code, evaluates the height of the table object, and sets the top of the graph that has to move its position depending on quantity of preceding rows.

It has worked fine for me, and hopes that help to you too..

Regards

Javier

Sub AjustaGrafico

  set Tabla = ActiveDocument.GetSheetObject("CH03") 'Table

  set Grafico = ActiveDocument.GetSheetObject("CH08") 'Graph

  Set PosTabla = Tabla.GetRect

  Set PosGrafico = Grafico.GetRect

  Cabezal = 22

  Pie = 10

  Fila = 16 'cell.LineHeight

  Cnt = Tabla.GetRowCount

  Alto = Cabezal + Pie + (Cnt * Fila)

  PosGrafico.Top = PosTabla.Top + Alto

  Grafico.SetRect PosGrafico

End Sub

Diarios.png

Avisos.png

qolkaram
Contributor III
Contributor III

Hi,

Sorry Guys to reply to this old post, but I'm wondering how to fix this issue in the web view. macro has solved the issue when using desktop , but when the report published on QlikView access point again charts positions are messed up.

Thanks

Nassim