Dynamic date in Header
how can I insert a dynamic date in the heading of a report?
Thanks in advanced
------------------------------
Stefan Batalia
Board Administrator
Optibelt GmbH
Germany
------------------------------
Answers
-
Hi @Stefan Batalia,
thanks for reaching out to us. This is a question arousing quite often.
There are different approaches to achieve your aim.
Option 1 - the "refer to" with "@-subsitution.
If your DataView blocks are using a "refer to" (a so-called block-selection) you could use the "@-substitution. This means that a selection applied to the block using refer to" can be referenced in the block's header with "@selection":
Let's assume a block defined with a reference to the year 2018:
Then you can show the year selected by this "refer to" in the header of the block.
This could result in something like this:
You can see the year 2019 selected on the screen, the first block showing data using the "previous year" option (thus displaying values from 2018) which are really selected in the third block. The second block displays figures for one product group only using the year 2019.
This is to demonstrate that the "@-substitution doesn't work on other selections than the refer to".
But, the "refer to" can be set dynamically using a procedure to do a so-called layout-injection (please have a look at this Webinar in our Tips & Tricks Tuesdays series: WEBINAR 9: Data Analysis (Automating Layouts & Screens) for more detail on this).
Option 2 - using a second DataView.
You could use a second DataView just to display the header information. Both DataViews should reside in a panel object and be linked. Both should have their headers set to invisible.
Your first DataView displays the information you already show in your screenshot. The second one will be built up of text-algorithms in the form
"@Year+1" or "@Year-2" (the name of the year's entity depends on your database). You can combine the outcome of those formulas with additional text as in "5 YP "&@Jahr+5.
Having selected the year 2019 this would result in the following:
Combine the two DataViews, link them (so that they scroll accordingly), adjust their column width, disable the headers being displayed and you're done ;-)
The panel is required if you want to export the data in a printable format so that both DataViews are still combined in the output.
Hope this helps,
Helmut
------------------------------
Helmut Heimann
Senior Consultant
Board Community
Germany
------------------------------
-------------------------------------------0 -
Hi @Stefan Batalia,
I have some things to add Helmut's option 2:
You can also use #labels with a layout instead of a dataview if your not having a horizontal scrollbar.
Further, you can shift the label (or dataview as in Helmut's 2nd option) into the background of the dataview and format the upper dataview's header (so do not hide it) with a transparent background. That way you can still use the sort functionality or the sliding panel!
Here my example:
Best regards
Bettina
------------------------------
Bettina Clausen
Consultant
Board
Germany
------------------------------
-------------------------------------------0 -
Hello Helmut Heimann,
thanks for the quick replay.The first Option I test, I think it is a good solution for me.
The second option is a little bit complicated.
------------------------------
Stefan Batalia
Board Administrator
Optibelt GmbH
Germany
------------------------------
-------------------------------------------0 -
Hello Stefan,
you could, of course, even more elegantly, combine option 1 with a custom time entity (e.g. Reporting Year) hierarchically connected to the standard dimension "year". You would in this case not need any layout injection and the relationship between year and Reporting Year has to be adjusted just once per year. And the "refer to" could remain static.
Kind Regards,
Helmut
------------------------------
Helmut Heimann
Senior Consultant
Board Community
Germany
------------------------------
-------------------------------------------0 -
Hello all,
we have tried to implement the second option.
The first line is the header we will hide.
The second line is the Block value.
Now we have the problem that the text in the block cannot be displayed in two lines as in the headline.
How can we configure that?
Thanks in advanced
------------------------------
Stefan Batalia
Board Administrator
Optibelt GmbH
Germany
------------------------------
-------------------------------------------0 -
Hello Stefan,
there is an option to wrap the text in the columns:
If you tick this, your problem should be solved.
Kind Regards,
Helmut
------------------------------
Helmut Heimann
Senior Consultant
Board Community
Germany
------------------------------
-------------------------------------------0 -
Hello Helmut,
I found the options, super.We are still working with the Windows Client V10.1.4, and the settings are slightly different in the windows client than in the web client.
Now we have to make some design adjustments, then we could think about that option.
@Bettina
can you explain your article with the Label with other words, we don't know what you mean.
Thanks on all
------------------------------
Stefan Batalia
Board Administrator
Optibelt GmbH
Germany
------------------------------
-------------------------------------------0 -
Hi @Stefan Batalia,
of course.
In my example I have a dataview with two columns. The first column shows always the previous year values and the second one the current year:
For block a I assign the header title " ", so no title will be shown. Further, in my formatting settings the header background color is set to transparent.
As a second I object, I create a label which should contain the dynamic header information of my first table column. I used this layout:
Last but not least, I position the label object behind the dataview so that the label looks like it is a header information.
By having the dataview on top of the label, you can still use most of the functionalities like the sorting (by clicking on the header), having headers in drill and the sliding panel, which would not be possible if you hide the dataviews header.
Of course you can also put a second dataview for headers as Helmut has suggest instead of labels behind the regular dataview.
Hope now it's more understandable, otherwise feel free to ask what's been unclear
Best regards
Bettina
------------------------------
Bettina Clausen
Consultant
Board
Germany
------------------------------
-------------------------------------------0 -
Hello all,
now we have setup a label with the following options:
Following the result, almost perfect.How can I center the text in the block in the label now (as in the block to the left)?
Thanks in advanced
------------------------------
Stefan Batalia
Board Administrator
Optibelt GmbH
Germany
------------------------------
-------------------------------------------0 -
Hi @Helmut Heimann,
I tried option 2 which uses the two dataviews and text algorithms. Block B does not populate the month March month when I enter the algorithm "@Month-1". Do you know what is wrong? I added a cube since the layout errors out if I don't have a cube as the first block. Thank you.
------------------------------
Yvonne Tran
United States
------------------------------
-------------------------------------------0