Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
troyhimes
Resolver I
Resolver I

DB2, Incremental Refresh, Query Folding Basics

Hello,

I am querying a DB2 db but fails every so often due to a time out error.  I've never used incremental refresh but understand that this would probably be a solution and that query folding is required.  Google tells me that query folding is possible with a DB2 query but for some reason it doesn't seem to be working for me.  Anything that I'm missing?

 

troyhimes_1-1713207656958.png

troyhimes_2-1713207722814.png

 

 

 

11 REPLIES 11
PatMcF
New Member

When I attempt to enable folding via the Value.NativeQuery function I get a message saying that the EnableFolding option is not available.

PatMcF
New Member

I cannot find any evidence to suggest that query folding is possible with DB2.

PatMcF
New Member

I can find no evidence to suggest that it is possible to implement query folding against DB2 queries.

troyhimes
Resolver I
Resolver I

There has to be some Db2 folders out there.....anyone?

troyhimes
Resolver I
Resolver I

Yolo,

1. The difference in the 'Source' step in my case (Db2) vs your example (SQL) is that the 'Database' definition in the first step is required vs optional.  That's the reason my first 'Source' step includes the 'Database' name.

troyhimes_0-1713455197272.png

troyhimes_1-1713455208582.png

2. I've tried dropping the "" from the database name and still no luck 

Source: 

troyhimes_3-1713455424902.png

Custom1

 

troyhimes_2-1713455267542.png

 

 

Anonymous
Not applicable

Hi @troyhimes 

Based on your descriprion, you can refer to the following link about the query folding.

Query folding examples in Power Query - Power Query | Microsoft Learn

Understanding query evaluation and query folding in Power Query - Power Query | Microsoft Learn

And if you  want to find which steps are preventing your query from folding, you can use the query folding indicators  to check, you can refet to the following link.

Query folding indicators in Power Query - Power Query | Microsoft Learn

And you can refer to the following link to know more about incremental refresh.

Incremental refresh for semantic models and real-time data in Power BI - Power BI | Microsoft Learn

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thanks for the response Yolo ( @Anonymous ) and the links.  I had already reviewed all of those in my initial quest.  Any guidance specifically in relation to query folding and Db2?  From the screenshot above query folding is dead at the 'source' step (right click on 'Source', 'View Native Query' is greyed out).  Does it have to do with using the 'Microsoft' driver rather than IBM?  The query doesn't work when using the IBM driver.

Anonymous
Not applicable

Hi @troyhimes 

Thanks for your quick reply.  After testing, the source step itself is not collapsible, it only acts as a connector to connect to the data source, but in order to ensure that the later steps can be collapsed, you can refer to the following steps:

1.Make sure that your connect mode is import, don't filter in advanced options. just click ok

vxinruzhumsft_0-1713319547095.png

 

2.Select the database , then click 'Transform data'

 

vxinruzhumsft_1-1713319645933.png

3.Add a new step in power query , then refer to the following code.

 

= Value.NativeQuery(xxxx(your database name),"select * from SQLTest",null,[EnableFolding=true])

 

Then you can find the query folding can use.

vxinruzhumsft_2-1713319929418.png

And you can refer to the following video.

Bing Videos

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Thanks Yolo (@v-xinruzhu-msft ), we're getting close.  I had previously watched that video too but couldn't get it to work.  I believe it may be something simple in the way I'm writing the command.  Do you see anything that may be causing the issue?

troyhimes_0-1713378385205.png

troyhimes_1-1713378392786.png

Anonymous
Not applicable

Hi @troyhimes 

Thanks for your quick reply, based on the picture you have offered,

You need to enter the database first, you can refer to the step I offered above.

vxinruzhumsft_0-1713402990190.png

Then you don't need to use " " for the database name, try this.

 

Value.NativeQuery(FXXD,"select * from jdeview",null,[EnableFolding=true])

 

 

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Yolo ( @Anonymous ),

1. One difference on the 'Source' step betwen mine (Db2) and your example (SQL) is that the database name is required in the first step for Db2 source vs a SQL source.

troyhimes_0-1713470219282.png

troyhimes_1-1713470233070.png

 

2.  With that in mind, here's how it goes down for me.... tried it a couple different ways, but it ends with an error either way

troyhimes_2-1713470347201.png

troyhimes_3-1713470377996.png

Try #1

troyhimes_4-1713470402868.png

Try #2

troyhimes_5-1713470594560.png

 

 

 

 

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors