Skip to main content
Question

Hello All,I am working on python code to get the last updated date for tables across multiple Data Models. I am facing an issue while passing the Variable to Filter.Please share your expert opinion ont this topic.RegardsSaravanan.G

  • October 21, 2022
  • 3 replies
  • 8 views

3 replies

janpeter.van.d
Level 12
Forum|alt.badge.img+26

Hi @saravanan.gopal,

 

To be honest, I have no experience in parsing variables in PQL filters. However, you are trying to insert a variable value into a text/string, and therefore another syntax is required.

 

Please try the snippet below:

query += PQLFilter(f"Filter {table_field} >= add_days(TODAY(),-7);")

 

The 'f' before the string stands for 'format', which means that python knows that he has to fill in parameters. Therefore, it will look for curled brackets and will parse that value.

 

Let me know if this works!

 

Kind regards,

Jan-peter


Hi @saravanan.gopal,

 

To be honest, I have no experience in parsing variables in PQL filters. However, you are trying to insert a variable value into a text/string, and therefore another syntax is required.

 

Please try the snippet below:

query += PQLFilter(f"Filter {table_field} >= add_days(TODAY(),-7);")

 

The 'f' before the string stands for 'format', which means that python knows that he has to fill in parameters. Therefore, it will look for curled brackets and will parse that value.

 

Let me know if this works!

 

Kind regards,

Jan-peter

Hello @janpeter.van.d 

 

It's working perfectly. Thanks for the reply.

 

Thanks a lot.

 

Regards

Saravanan.G


janpeter.van.d
Level 12
Forum|alt.badge.img+26

Hello @janpeter.van.d 

 

It's working perfectly. Thanks for the reply.

 

Thanks a lot.

 

Regards

Saravanan.G

Glad to hear!