Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Pre-Define Dimesion Group Settings within Load Script?

Hi Qlikkies,

Just a general inquiry from my side.

Is it possible to Pre-Define Dimesion Group Settings within Load Script?

To illustrate:

We have an IF statement in the load script defining alot of settings based on different initial values.

We have 2 entities with different Year measurements one being a calendar year and the other financial year for example.

We use this as a "Time" group in a dimension.

Therefore:

IF '$(vName)' = 'pse' THEN
let vFolderSourceData = 'C:\QlikView\Data FilesPSEMAS\';
let vStartPer = '01/04/2012';
let vStart = '201204';
let vEndPer = '30/06/2016';
let vEnd = '201606';
let vSchemePeriod = '0006201204';
let vCalendarYear = '=FinYearPsemas' ;
ELSE
let vFolderSourceData = 'C:\QlikView\Data Files\';
let vStartPer = '01/01/2012';
let vStart = '201201';
let vEndPer = '30/06/2016';
let vEnd = '201606';
let vSchemePeriod = '0001201201';
let vCalendarYear = '=Year' ;
END IF  

============================================================================================

So what i want to know is how to in the script above achieve the changes shown below:

 

IF '$(vName)' = 'pse' THEN

image1.png

ELSE

image2.png

END IF  

Your soonest replies would be greatly appreciated.

Thank you!

1 Solution

Accepted Solutions
MVP
MVP

Re: Pre-Define Dimesion Group Settings within Load Script?

Click on the 'expression' from the drop-down and write your expression there like:

=If (vName='pse', FinYearPsemas, Year)

Untitled.png

6 Replies
MVP
MVP

Re: Pre-Define Dimesion Group Settings within Load Script?

Not sure if understood right. You may create two groups like time1  and time2 and then while use then in chart, use conditional dimension like:

Untitled.png

Re: Pre-Define Dimesion Group Settings within Load Script?

Is it possible to Pre-Define Dimesion Group Settings within Load Script?

No, but you can use expressions to create calculated dimensions to use in your group.


talk is cheap, supply exceeds demand
Not applicable

Re: Pre-Define Dimesion Group Settings within Load Script?

Thank you gentleman for your replies. Found it most enlightening.

Now 1 more question on a similar basis.

Would it be possible either in load script or in conditional (Though in a list box i dont see a conditional) to pre-define The FIELD Namely in below FinYearPsemas  :

image3.png

To change based on the 'pse' variable in previous post to the below specifically on a list box object:

image4.png

Your insights are welcome.

Regards,

Heinrich

MVP
MVP

Re: Pre-Define Dimesion Group Settings within Load Script?

Click on the 'expression' from the drop-down and write your expression there like:

=If (vName='pse', FinYearPsemas, Year)

Untitled.png

Not applicable

Re: Pre-Define Dimesion Group Settings within Load Script?

Your experience is well appreciated.

oknotsen
Honored Contributor III

Re: Pre-Define Dimesion Group Settings within Load Script?

If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post) and Helpful Answers (found under the Actions menu under every post).

If not, please make clear what part of this topic you still need help with .

May you live in interesting times!
Community Browser