Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How to make 4 part of my script into 1 ? for easy maintenance

Hi All

My diamension 1 to 4 have 30 items for user selection.

I have to duplicate my script 4 times. and when i change i need to change at 4 part. it there a sample approach ? ( Notice that the only different is 1 2 3 4.

Sample of my code as below :-

WhatIfDimension:

LOAD * INLINE [

    Pls select 1st Dim,Column1

  Desc,GL_DESC

  Code,GL_CODE

  company,company

  ];

WhatIfDimension:

LOAD * INLINE [

    Pls select 2st Dim,Column2

  Desc,GL_DESC

  Code,GL_CODE

  company,company

  ];

WhatIfDimension:

LOAD * INLINE [

    Pls select 3st Dim,Column3

  Desc,GL_DESC

  Code,GL_CODE

  company,company

  ];

WhatIfDimension:

LOAD * INLINE [

    Pls select 4st Dim,Column4

  Desc,GL_DESC

  Code,GL_CODE

  company,company

  ];

1 Solution

Accepted Solutions
Sokkorn
Honored Contributor

Re: How to make 4 part of my script into 1 ? for easy maintenance

Hi Paul,

You may try script below to reduce repeat typing in load script:

For Each i in 1,2,3,4

WhatIfDimension$(i):

LOAD * INLINE [

  Pls select $(i)st Dim,Column$(i)

  Desc,GL_DESC

  Code,GL_CODE

  company,company

  ];

NEXT i;

By the way, you may thinking about Alternative State function also.

Regards,

Sokkorn

4 Replies
Sokkorn
Honored Contributor

Re: How to make 4 part of my script into 1 ? for easy maintenance

Hi Paul,

You may try script below to reduce repeat typing in load script:

For Each i in 1,2,3,4

WhatIfDimension$(i):

LOAD * INLINE [

  Pls select $(i)st Dim,Column$(i)

  Desc,GL_DESC

  Code,GL_CODE

  company,company

  ];

NEXT i;

By the way, you may thinking about Alternative State function also.

Regards,

Sokkorn

Not applicable

Re: How to make 4 part of my script into 1 ? for easy maintenance

Concatenate those 4 tables , it will be definetely provide a solution...

Not applicable

Re: How to make 4 part of my script into 1 ? for easy maintenance

Hi Sok

Thank you , it work.

The tiger is vey far away from you ?

Paul

Sokkorn
Honored Contributor

Re: How to make 4 part of my script into 1 ? for easy maintenance

Mr. Paul,

It around 0.5m away from me . You can find it in Changi Airport.

Regards,

Sokkorn

Community Browser