Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

anilnaidu13
Contributor

For repeated expression in 'n' of objects how can i write variable at edit script level

Hi friends,

i have a repeated Expression in 'N'  of objects.

How can i write variable at edit script level.

Below is the sample expression

COUNT(Distinct {<Phase={'Live'},Age={'>=0<=30'}>}SOW_CT).

The above expression we are going to using around 6 objects.

I know one method Settings---->Document Properties ---create variable---New etc....,

let me know your suggestion for reuse of expression from Edit script level

InAdvance

Thank you

2 Replies

Re: For repeated expression in 'n' of objects how can i write variable at edit script level

In the script, you use must use SET or LET to populate a variable:

SET Variable = 'COUNT(Distinct {<Phase={'Live'},Age={'>=0<=30'}>}SOW_CT)';

Then you can use the variable in your charts inside of dollar sign expansion:

$(Variable)

Not applicable

Re: For repeated expression in 'n' of objects how can i write variable at edit script level

hi Anil,

you can go through this link for more understanding of variable as reusable code

http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/04/the-magic-of-variables