Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
MikeJohn
Contributor II
Contributor II

Aggregate certain entries

I have a table that has many columns. one of them is called "Type" and another "Number".

E.g.

ID,FieldA,FieldB,Type,Number

1,A,B,Type1,17

2,C,D,Type2,30

3,A,D,Type1,12

4,B,C,Type2,45

 

There are like 100 different type entries. And after import i can actually choose Type17 and than i get the numbers for Type 17.

 

I would like to aggregate certain types to a new Entry in Types. (Like if i would multi select them)

For example

TypeX = Type 17+ Type23+Type45

TypeY = Type1 + Type87+Type33

 

Is it possible to do this during loading and "add" those aggregated types at the beginning of the Type selection field? So it would like like this

TypeX,

Typey,

Type1

Type2

Type3

....

 

Basically a "shortcut" to a multi selection.

 

if it is not possible in loading, can I somehow ust create a new multibox with those agregated Types?

 

Labels (3)
12 Replies
rubenmarin

And wich values should have  FieldA, FieldB and ID? there should be 2 rows with number 57?

It it's only one row you can do using TypeSelector as dimension (and you can change field names in script to the ones you want) and using Sum(Number) as expression

Captura.JPG

Write in a post what's the expected result for the full table.

Brett_Bleess
Former Employee
Former Employee

If Ruben or Vegar's latest posts helped you get things working, we would appreciate it if you would return to your thread and properly close it out by using the Accept as Solution button on the post(s) that got you the information you needed to get a working solution.  I am assuming one of the last two posts on the thread helped, but I do not know which one, so I could not mark this for you...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Saravanan_Desingh

One solution is, create a new Field.

tab1:
LOAD IterNo() 					As ID
	,Pick(Ceil(6*Rand()),'A','B','C','D','E','F') As FieldA
	,Pick(Ceil(6*Rand()),'F','E','D','C','B','A') As FieldB
	,'Type'&Ceil(Rand()*25) 	As Type
	,Ceil(100*Rand()) 			As Number	
AutoGenerate 1
While IterNo()<=25;

TypeExt:
LOAD * INLINE [
    TypeExt, Type
    TypeX, Type17
    TypeX, Type23
    TypeX, Type1    
    TypeY, Type18
    TypeY, Type3
    TypeY, Type20
];

Concatenate(TypeExt)
LOAD Distinct Type, Type As TypeExt
Resident tab1;

Left Join(tab1)
LOAD * Resident TypeExt;

DROP Table TypeExt;

commQV60.PNG

commQV61.PNG