Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Partner
Partner

Using the "Window Title" / "Caption" in the expressions

Using the "Window Title" / "Caption" in the expressions

I have a dashboard in which multiple gauges indicate how the production ratio is doing on each machine.

Naturally the "Window Title" / "Caption" contains the machine name.

For easy maintanance, I'd like to refer to my caption in my Set Analysis throughout the Chart object, instead of having to change it each and every time manually.   As approcimantly 40 machines are displayed (40 gauges)

And each gauge has about 21 references to the machine in set analysis

  • Expression used for gauge [2 instances]
  • Expression to create Popup [10 instances]
  • Segment setup [4 instances]
  • Text in Chart objects [5 Instances]

Anyone a good idea to simplify maintenance?

1 Solution

Accepted Solutions
Partner
Partner

Re: Using the "Window Title" / "Caption" in the expressions

Perfect !!!

That's it... to be precise:

SUM({$<Dimension={$(=MID(GetObjectField(0),2,4))}>} Measure)

Example for the expression:

=SUM({$<STATUSCODE={'M'},MACHINENR={$(=MID(GetObjectField(0),2,4))}>} MINS)/SUM({$<STATUSCODE={'M'},MACHINENR={$(=MID(GetObjectField(0),2,4))}>} PlannedMinutes)

The MID(...,2,4)   is to remove the '=' from the returned value that the  GetObjectField(0) gives

View solution in original post

5 Replies
MVP & Luminary
MVP & Luminary

Re: Using the "Window Title" / "Caption" in the expressions

Use a variable for the machine name? Perhaps use variables everywhere, i.e. move all the expressions to variables as well. You can put the variables in a script file or excel file for easier maintenance and use that file to load the data and create the variables in the script.


talk is cheap, supply exceeds demand
Partner
Partner

Re: Using the "Window Title" / "Caption" in the expressions

That is not a solution... As then you still need to change the variable name in each gauge on every spot, not making life any simpler whatsoever.

MVP & Luminary
MVP & Luminary

Re: Using the "Window Title" / "Caption" in the expressions

Unfortunately there aren't any functions to read the caption or the object-id (unless you would use macros which are generally not recommended for front-end usage and which would be rather no or less benefit in your case).

The only thing which could be read are the dimensions of an object and this might be a workaround for you. This meant you could write the machine-name within the dimension (a gauge normally ignored dimensions) and use this as a reference in a parametrized variable:

Dimension:

= 'Machine1'

and getobjectfield(0) will return 'Machine1' and used within an expression with a variable like:

$(eExp1($(=getobjectfield(0)))

might then minimize your efforts for maintaining. This here: How to get the dimensions of the current chart? is not quite the same but it could help you in understanding what I'm talking about.

- Marcus

Partner
Partner

Re: Using the "Window Title" / "Caption" in the expressions

Perfect !!!

That's it... to be precise:

SUM({$<Dimension={$(=MID(GetObjectField(0),2,4))}>} Measure)

Example for the expression:

=SUM({$<STATUSCODE={'M'},MACHINENR={$(=MID(GetObjectField(0),2,4))}>} MINS)/SUM({$<STATUSCODE={'M'},MACHINENR={$(=MID(GetObjectField(0),2,4))}>} PlannedMinutes)

The MID(...,2,4)   is to remove the '=' from the returned value that the  GetObjectField(0) gives

View solution in original post

MVP & Luminary
MVP & Luminary

Re: Using the "Window Title" / "Caption" in the expressions

You will need to set up the variables only once. Doing that in something like excel allows you to do that very quickly.

And you will always need to set things up first anyway, whether you use machine names strings or variables or something else. Once you've set up the variables the only thing you need to do is change the contents of one variable per gauge instead of having to edit 21 expressions per gauge. If that's not an improvement then I you must have a different definition of that word.

Or are you looking for a solution that generates all your gauges from scratch for you? That too will need quite a bit of work to set up. Or a lot more machine intelligence than Qlikview has built in.


talk is cheap, supply exceeds demand