Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Can a variable be used in a header/footer of a QVW report

Hello

Is it possible to put the last refresh time of a qvd into the header/footer a report which I have created within the QVW.  I would like to put the following into a report, but as it is a variable, it does not seem to show.

 

='Data Last Reloaded : ' &

v_diagnostics_time

Does anyone know if this is possible?

Thanks

Helen

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Sorry, didn't notice that it's about header/footer of report.

You're right.

The only way that I've found is to use separate field:

LOAD

      QVDCreateTime(C\QVD\Diagnostics.qvd) as diagnostics_time

autogenerate(1);

View solution in original post

11 Replies
jpapador
Partner - Specialist
Partner - Specialist

Use the built in function and it will work.  For example:

='Last updated ' & Date(ReloadTime(), 'MMM DD, YYYY h:mm TT')

Obviously use whatever formatting you'd like

whiteline
Master II
Master II

Hi.

Depending on what value is stored in the variable you could also try one of these:

='Data Last Reloaded : ' & $(v_diagnostics_time)

='Data Last Reloaded : ' & $(=v_diagnostics_time)

helen_pip
Creator III
Creator III
Author

Hello

Thanks for your reply

I have tried your technqiue and it seems the header/footer does not recognise my variable and in print preview I get

Date Last Reloaded:

I have looked at my variable and can see the result as:

 

2013-05-15 07:00:35

The variable is written in my script as : 

let v_diagnostics_time = QVDCreateTime(C\QVD\Diagnostics.qvd);

Do you know why it does not recognoise my variable?

Kind Regards

Helen

whiteline
Master II
Master II

Sorry, didn't notice that it's about header/footer of report.

You're right.

The only way that I've found is to use separate field:

LOAD

      QVDCreateTime(C\QVD\Diagnostics.qvd) as diagnostics_time

autogenerate(1);

helen_pip
Creator III
Creator III
Author

Hello

Thank you for your response

In the script I have craeted the seperate field.

Now in the header/footer I have put =Diagnostic_Time and had hoped the time would show, but alas it just simply reads as

=Diagnostic_Time.  

How do I now reference the field in the header/footer?

Your help is very much appreciated

Thanks

Helen

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

Hello helen_pip

See the attached image ..

sample.bmp

1) Create a new variable, in this example vPage

2) Assign the expression to this variable

3) Use the var on the repport settings dialog

My goal was write the expression marked on green, the explantion of the expression is.

a) FieldValue(Idioma, 313) for the text 'Page' on the user language

b) chr(38) & chr(91) & 'Page' & chr(93) to add &[Page] function

c) FieldValue(Idioma, 314) for the text 'of' on the user language

d) chr(38) & chr(91) & 'Pages' & chr(93)  to add &[Pages] function

Your goal if complete the vPage with your own expression. Good luck

whiteline
Master II
Master II

Hi.

It's strange.

QlikView really shows the reference as =Diagnostic_Time.

But when you print/preview the report the value is shown correcly (see the screens attached).

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

Yes, it's the difference between 'Design Time' and 'Run Time'

helen_pip
Creator III
Creator III
Author

Thank you!   This works now!

Thanks

Helen