Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

How to extract field name(s) from an Expression?

Hi there,

I was wondering if there is a way of extracting fields used within expressions for instance Sales from Sum({<Name={'Alex'}>}Sales)?

I need a solution that can be applied on more complex expressions.

Many thanks,

Laleh

1 Solution

Accepted Solutions

Re: How to extract field name(s) from an Expression?

You can look at the code in Doc Analyzer to see how I do it. Note that I don't actually parse the fields out of the expressions, but rather look for strings that match existing field names. Not too sophisticated, but it works.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

8 Replies

Re: How to extract field name(s) from an Expression?

extract it? extract the field name where? Not sure I understand, can you elaborate?

Not applicable

Re: How to extract field name(s) from an Expression?

Hi Sunny,

So, I am creating a table of all the expressions and the fields used in those expressions of my application.Something like this:

DataDic.png

Now,I need to have a column that shows the fields used within each expression. Hope that make sense!

Re: How to extract field name(s) from an Expression?

It sort of does. I have no idea how to do this, but I hope someone else do (I will get to learn something new as well ) May be swuehl‌ or rwunderlich

Best,

Sunny

Re: How to extract field name(s) from an Expression?

Are you aware that a tool that does exactly this already exists?

The Document Analyzer (Tools | Qlikview Cookbook) created by rwunderlich‌ will take care of all of this for you.

Not applicable

Re: How to extract field name(s) from an Expression?

Hi Nicole,

Thanks for your reply. Yes I am, just want to create a simpler solution for my application as it requires less complex functionality. And,I would learn something new if I could work it out.

Thanks again

Re: How to extract field name(s) from an Expression?

You can look at the code in Doc Analyzer to see how I do it. Note that I don't actually parse the fields out of the expressions, but rather look for strings that match existing field names. Not too sophisticated, but it works.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Not applicable

Re: How to extract field name(s) from an Expression?

Hi rwunderlich‌,

Thanks for the info, I am looking into the Doc Analyzer script. Will get back to you if I need to understand how you did it. Great job I should say

Re: How to extract field name(s) from an Expression?

‌maybe the Governance Dashboard can help you as well to get an overview of your expressions.

regards

Marco

Community Browser