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

View all objects that use a particular field

Hi,

I have a large QV document which I need to update.

Historically there were two fields which help slightly different categorisation information which we now want to combine into a single field.

I need to be able to generate a list of all of the objects that use either field as a dimension or expression.

I have tried the excellent DocumentAnalyzer by Rob Wunderlich but it won't run for this file. I think the file may be too large.

I am sure this is a problem that everyone has faced at one time or another!

Help please!?

Thanks,

Alan

11 Replies
Not applicable
Author

Hi,

I have had problems running Rob's extremly composite Document Analyzer with one of my QVWs, perhaps my doc was too big to analyze like in your case.

I think you can use a button with Select in Field trigger for yourfield with * as search string or a Trigger like Select Possible where you can specify yourfield name in the Field section of the trigger.

This won't definitely give you a list, but will at least give you a way to see the tables or sheets where your the field-you-are-looking-for is used. This might help as a starter.

Perhaps, the community experts can help better.

Regards,

-Khaled.

vgutkovsky
Master II
Master II

Alan,

The only way to do this is with a macro. Take a look at the APIGuide, specifically referencing functions getfield() which would be used for data tables and dimensions() which would be used for graphical charts. You would need to write a loop to search through all objects and all dimensions. Overall, you should probably expect that this won't be a very simple macro.

There is a simpler possibiliy, however. A QVW is, in fact, an XML file that has been renamed to a .QVW extension. Meaning, you can actually read it into another QVW as a source. Here's what you would need to do:

(1) Create a new QVW file, go to the script editor, select Table Files, change the filter to "All Files" and open your main QVW. You will see a bunch of gibberish. Change the File Type to "Xml" and you will magically get a decoded version. Press finish.

(2) You will get an autogenerated list of table loads, but you don't need all of these. Keep only the 2 labeled DocumentSummary and SheetObject, and delete the other loads. Reload the application.

(3) Inside the DocumentSummary table you will see a field called "Definition" that will contain a list of all expressions. You can use the Definition field to search for expressions that use the field that you care about. The field [Expression/ObjectId] in this table will give you the Id of the object that has the expression.

(4) Inside the SheetObject table you will see a field called "Field" that will contain a list of all dimensions. You can use this field to search for dimensions that use the field that you care about. The field [ObjectId] in this table will give you the Id of the object that has the dimension.

Let me know how it works out for you!

Vlad

Not applicable
Author

Hi Vlad,

This is a very interesting approach.

I have tried the above however I have not been able to get past the first step. When I select the file and change the file type to 'XML' I get the following message onscreen:

An invalid character was found in text content.

On line number: 1. On Column number: 2. System ID:

<file path details i.e. C:\xxx\xxx\

I have tested this with three separate files.

Any ideas?

Thanks

Alan

vgutkovsky
Master II
Master II

Alan,

I've tried this on my machine with multiple files and it always works (verified in v11 only though).

Vlad

Not applicable
Author

I also see this. I wonder why it doesn't work for us?

EDIT: Ah, silly me. By default, if you browse for the files, the file type is "All Table Files". Since the reload log is named as "MyDocument.QVW" it shows there and I was just clicking on that, instead of the actual QV file. Had to change the file type to "All files" and then I saw th QV file as well

Message was edited by: Henry Backman

vgutkovsky
Master II
Master II

Henry, take a look at my blog post here, hope it helps you: http://www.infinityinsight.com/blog/?p=235

Cheers,

Vlad

Not applicable
Author

Try to make a project folder.

The folder name should be the same as qvw, for example, if your qvw name is 'MyQvw.qvw' then the folder name is 'MyQvw-proj'. Project folder should be in the same directory where the qvw is. Then you open the qvw and press save button then you'll see xml documents generated for all objects in the qvw so you can grep where the field is used!

Not applicable
Author

hi,

I'm also facing same kind of issue when loading from xml to qlikview.

Do you found any solution to this ?

Thanks in advance.

Not applicable
Author

Hi there,

I have exactly the same issue did you find a solution on that??

Regards,