Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
afonsogyn
Contributor II
Contributor II

Verificar se relatório esta atualizado.

Olá.

 

Criei uma variável que retorna quantas horas o relatório foi atualizado.

SET vL_Horas_Atualizacao = (Now() - $(vL_Data_Arquivo)) * 24;

 

afonsogyn_0-1648152132227.png

 

 

Ao adicionar essa variável como Condição ele sempre retorna true.

 

Preciso verificar se a base está atualizada ou não antes de enviar o relatório.

 

 

Labels (2)
1 Solution

Accepted Solutions
afonsogyn
Contributor II
Contributor II
Author

Hi everybody.

I tried a lot of different ways.

The only expression that work it's:
'=((Now() - Max(Data_Arquivo)) * 24)'

 

Best Regards.

View solution in original post

6 Replies
Digvijay_Singh

What I observed is Now() gives hours in 24 hr format, not sure if other date you have is in the same format, I tested this and I needed to subtract 12 from now() to get actual hours, not sure if you this situation - 

(frac(Now())*24-12) - frac(date#('03/24/2022 01:50:00','MM/DD/YYYY hh:mm:ss'))*24

afonsogyn
Contributor II
Contributor II
Author

Hi Digvijay.
Thanks for your help.

I tried using your suggestion but didn't work for me.

I think that my formula it's ok, when I show on some kpi. but when a try use like a nprinting condition didn't owrk.

afonsogyn_0-1648157178613.png

 

Ruggero_Piccoli
Support
Support

Hi, 

Please post new conversations in English and add the label with the correct version of Qlik NPrinting you are using because the answer could depend on that information.

About formulas I suggest you to test them in Qlik Sense before inserting in Qlik NPrinting also because Qlik NPrinting send them for evaluation to Qlik Sense as you are doing. Be sure that in Qlik Sense the result of the condition is the same you expect in Qlik NPrinting.

Please also note that you can apply conditions to a publish task or to reports in publish tasks and that influences the result.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
afonsogyn
Contributor II
Contributor II
Author

Hi Ruggero.

My main idea was to post on a portugês group. I did some mistakes and change the destination.

I check the formula on Qlik Sense and it's working.

I don't know what it's it's wrong.

 

 

 

Ruggero_Piccoli
Support
Support

Hi,

In Qlik Sense did you tested something like =IF(vl_Horas_Atualizacao < 10, True, False)? I mean in the second screenshot you posted there is a different variable than in the first one. So be sure that the Boolean expression used in the condition is working correctly in Qlik Sense.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
afonsogyn
Contributor II
Contributor II
Author

Hi everybody.

I tried a lot of different ways.

The only expression that work it's:
'=((Now() - Max(Data_Arquivo)) * 24)'

 

Best Regards.