Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
vanir88
Creator
Creator

How to use bith max string and concat expressions in one dimention

Hi All,

good day,

can you please help how to used below both conditions to use in single dimension., if use single condition it is working but if i combine both with "and " i am getting invalid Dimension. and i am giving this condision in Group dimension

Aggr(MaxString([Location]),[Industry])

and

aggr(Concat([Industry], ','), [Master Number])


the above contion is to get below scenario

Master  Number Master Name Contract Number Location Group
1137 EXOR 99698 Italy Automotive,Comms & Media,Not Available,Utilities

 

 

11 Replies
rubenmarin

Hi, I don't fully understand, can you post some more sample rows and the expected result?

Can you also add Industry to the sample data?

vanir88
Creator
Creator
Author

Hi, 

we have data like below and we are getting multiple locations (eg: italy...) so we need unique location and in group value we needs to be concate like Automotive,unitities,Not Available like this i sharing Screenshot in below

 

vanir88_0-1711962326307.png

Master  Number Master Name Contract Number Location Group
1137 EXOR 99698 Italy Automotive,Comms & Media,Not Available,Utilities

 

the condition which i mentioned individually it is working but if i combine i am getting invalid dimension

Aggr(MaxString([Location]),[Industry]) with this condition i am getting unique Location values

aggr(Concat([Industry], ','), [Master Number]) with this condition i am able to concatinate the group values 

but how can i give both conditions in same dimension? the above conditions i tried in Group dimension

 

 

Aggr(MaxString([Location]),[Industry])

and

aggr(Concat([Industry], ','), [Master Number])

rubenmarin

Hi, still I don't see where the Industry field comes from and the relationship with Location and Master Number.

I wanted some sample data to make tests,

Maybe with:

Aggr(MaxString([Location]) & Concat(TOTAL <[Master Number]> distinct Industry, ','),[Industry], [Master Number])

Satish3
Contributor
Contributor

Hi Exports, 

I want out put like below. Please any one help me guys. 

Dataintellinalytics

Can you please explain the last part, why are you trying to combine ? what is the combined dimension you are trying to create ?  

Satish3
Contributor
Contributor

 Hi, 

I want below output only please check attached  image. I want with script. 

rubenmarin

Hi, from this data:

OriginalData:
LOAD *,RowNo() as LoadOrder Inline [
ID,Subject,Marks
1,English,35
1,Maths,45
1,GS,65
2,Maths,75
2,GS,35
3,Physics,25
4,English,95
4,Maths,75
5,GS,85
];

 

You can create the diffrerent sub fields using a genric load as:

Data:
LOAD
	*,
	'Sub' & RowNumber as Sub
;
LOAD
	ID,
	Subject,
	Marks,
	If(ID=Peek(ID)
	  ,Peek(RowNumber)+1
	  ,1)		as RowNumber
Resident
	OriginalData
;

Subject:
Generic LOAD
	ID,Sub,Subject
Resident Data;

DROP table Data;

And the marks field as:

Marks:
LOAD 
	ID,
	Text(Concat(Marks,';',LoadOrder)) as Marks
Resident OriginalData
Group By ID;

Then you can drop the OriginalData table and you have the needed fields to create the table

rubenmarin_0-1712211472913.png

 

Satish3
Contributor
Contributor

Not correct my Output
rubenmarin

Correct in mine. I posted a sample.