Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

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

Labels (1)
1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

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

View solution in original post

6 Replies
jwjackso
Specialist III
Specialist III

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
Master
Master
Author

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
Specialist III
Specialist III

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

beck_bakytbek
Master
Master
Author

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
Specialist III
Specialist III

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
Master
Master
Author

Jwjacko,

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