Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
beck_bakytbek
Honored Contributor

Valuelist () or create a dimension in script area

Hi Folks,

my environment does look like: 

MainAccount, SubAccount, Type, Sales

100,  102, A, 5

100, 103, B, 2

110, 105, A, 3

110, 106, B, 2

200, 109, A, 1

 

My issue, create an additional dimension like: 210 = 200 + 110+ 100

I create this dimension (210) on userinterface within my table with the help of function: ValueList ()

Dim: ValueList ('100', '110', '200', '210')

Expression:

If(ValueList ('100', '110', '200', '210') = '100',

Sum({<MainAccount = {"100"}>}Sales),

If(ValueList ('100', '110', '200', '210') = '110',

Sum({<MainAccount = {"110"}>}Sales),

If(ValueList ('100', '110', '200', '210') = '200',

Sum({<MainAccount = {"200"}>}Sales),Sum({<MainAccount = {"*"}>}Sales))))

by this way i create my additional dimension: 210

 

My question, is there any possibilities to create this / such dimension within script-area?

Does anybody have any idea? 

Any suggestions or ideas are appreciated.

Thanks a lot

1 Solution

Accepted Solutions
jwjackso
Valued Contributor

Re: Valuelist () or create a dimension in script area

I created a test app with the data  and results in the images attached.  What are your results?sampleData.PNGsampleResults.PNG

6 Replies
jwjackso
Valued Contributor

Re: Valuelist () or create a dimension in script area

Why not try

vList:

load * inline [

vlist,MainAccount

100,100

110,110

200,200

210,100

210,110

210,200

];

If you sum on vlist, it is linked to the MainAccount.

beck_bakytbek
Honored Contributor

Re: Valuelist () or create a dimension in script area

Hi Jwjacko,

first of all thanks a lot for your responce and valuable time,

i' ve implemented but it does not work , but this suggestion is very cool

Do you have any alternative way? Thanks a lot

jwjackso
Valued Contributor

Re: Valuelist () or create a dimension in script area

I created a test app with the data  and results in the images attached.  What are your results?sampleData.PNGsampleResults.PNG

beck_bakytbek
Honored Contributor

Re: Valuelist () or create a dimension in script area

Hi Jwjackso,

it does work, i overlooked and  forgot to add the bracket at the end.

thanks a lot for your help and your time,

Jwjackso, do you mean, i can use this suggestion in my data-structure where i have a lot of data? (because you see only my example, the real case consists of a many data)

jwjackso
Valued Contributor

Re: Valuelist () or create a dimension in script area

If you have a rule that defines how you want to group the accounts, you should be able to create the inline table with the combination entries and then you can just concatenate to add the generic entries.

In the example that I gave,

VList:

load * inline [

vList,MainAccount

210,100

210,110

210,200

];

concatenate

load MainAccount as vList,

          MainAccount

resident Data;

beck_bakytbek
Honored Contributor

Re: Valuelist () or create a dimension in script area

Jwjacko,

thanks a lot for suggestion and help, have a nice evening 😃