Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Listing broken expressions / showing used fields

Question 1:

When changing a script I often have the problem finding all expressions which aren't ok (syntax error) anymore.

Is there a way of listing all broken expressions. Sometimes the problems are hard to find...

(I know that there's no chance of identifying problems within $(=...) or $(...) expressions.)

Question 2:

Is it possible to show all fields which are used within an expression?

--> this could help to remove all fields from the script that aren't needed anymore.

1 Solution

Accepted Solutions
marcus_sommer

I think the Document Analyzer V3.2 Update from Rob will be helpful for it.

- Marcus

View solution in original post

8 Replies
sunny_talwar

I am not sure if you have already looked at this, but looking at Expression Overview (Ctrl + Alt + E) partially helps

Capture.PNG

marcus_sommer

I think the Document Analyzer V3.2 Update from Rob will be helpful for it.

- Marcus

Anonymous
Not applicable
Author

Thank you for your answers, I'll try the Document Analyzer tomorrow.

Find / Replace is no option I think, because normally I change many thinks within one step.

sunny_talwar

Find / Replace is no option I think, because normally I change many thinks within one step.

Not sure I understand, but I guess you do have a venue to look into

Anonymous
Not applicable
Author

=Replace('Find / Replace is no option I think, because normally I change many thinks within one step.','thinks','things')

sunny_talwar

Document Analyzer will only point you to changes, but you won't be able to make bulk updates. Are you just trying to look at multiple changes in one spot? or are you also thinking of changing them? I think Find/Replace may come in handy if you have to fix the field names (87% of the time )

Anonymous
Not applicable
Author

Yes I know the "expression overview" and the possibility of find / replace. No doubt this is absolutely useful, if I want to do a bulk rename for example. But if I just change the name of one or two field within the script, then QlikView normally replaces the Fieldname within the chart expressions automatically.

But sometimes I have to change a qvw in a hurry. Then I rename some fields, add or remove qualify or unqualify, change to the order in the load script, splitt tables, concatenate tables and so on...

a)

Within the script, I have no problem to survey everything. But in rare cases an expression and/or condition outside the script gets broken and I don't notice it.... could be that the expression is located within a minimized chart ... or a sorting expression gets corrupted ... and that's why I am looking for a possibility of listing all corrupted expressions.

b)

Sometimes I load more fields, than I actually need, because  then I am able to change expressions outside the scripts in a faster way, because more fields are available and I don't have to wait for the completion of the reload process each time I need a new field from the database. But then it happens, that I lost the overview of the fields I really use... and so it would be good having a List which fields are really used by expressions / conditions ...

marcus_sommer

I think the tool from Rob could be taken to detect broken expressions by using and/or adjusting this object or a similar ones:

Further I believe that it could be extended on the script/modul-level whereby I'm not very familar with Rob's tool and think this won't be very easy by whose complexity. Therefore it might be easier to build this within your origin application itself by loading the expressions from the qvw xml-header. Here a snippet from an old (and bigger) routine (unfortunately I don't know from which tools all these scripts are - any mix-up from the earlier goverment material whereby I could imagine that the newer governance dashboard used similar ones):

//Expressions:

    OUTER JOIN LOAD

        //upper(filepath() & '\' & filebasename() & '.qvw')     as FileName,

        upper(filepath()) as FileName,

        ObjectId,

        'Expression'   as SOE_Type,

        Definition,

        Label

    FROM $(QVEName) (XmlSimple, Table is [DocumentSummary/Expression]);

- Marcus