Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
virus190
Contributor
Contributor

How to Group By (Empty Values)

Hi,

i cant solve my problem, maybe you can. It looks easy, but i have no idea.

So lets say, i have 2 tables:

1. Data:

virus190_0-1631027522580.png

2. ExtraData:

virus190_1-1631027557713.png

Now i want to create a table that looks like that:

virus190_2-1631027719671.png

I tried to use Masterelemts (for exampe) if(Group='Car',Brand), but then i get empty values like that:

virus190_3-1631027808711.png

What is the right way to solve this? With the data load editor? I tried but couldn't

Labels (1)
1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

You can use generic load for this that will unpivot your group and you can have brand as your cell value

https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470

 

If you must do it on front-end, i would do this:

=aggr( only({<group = {'car'} >} brand), id)

=aggr( only({<group = {'bike'} >} brand), id)

I chose only() (assuming there is only 1 bike or car per id.  You could choose concat() or maxstring() or whatever else you want to show in the case if there is > 1 record per id.

View solution in original post

3 Replies
stevejoyce
Specialist II
Specialist II

You can use generic load for this that will unpivot your group and you can have brand as your cell value

https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470

 

If you must do it on front-end, i would do this:

=aggr( only({<group = {'car'} >} brand), id)

=aggr( only({<group = {'bike'} >} brand), id)

I chose only() (assuming there is only 1 bike or car per id.  You could choose concat() or maxstring() or whatever else you want to show in the case if there is > 1 record per id.

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hi,

Maybe something like this.

Sample Dataset

Load * Inline [
ID,GROUP,BRAND
1,Car,RG
1,Bike,SETH
1,Airplane,SSRYN
2,Car,SHRTHB
2,Bike,SRHS
2,Airplane,SBF
3,Car,SNFBDF
3,Bike,NSFGBNSG
3,Airplane,SFHNSR
4,Car,NFGBNS
4,Bike,FGBSFGNB
4,Airplane,SFHNSFHN
5,Car,SFNSR
5,Bike,NSFHNSFH
5,Airplane,SNFHN ];

Output :

AshutoshBhumkar_0-1631029555271.png

Expressions : 

Car - Only({<GROUP = {"Car"}>}BRAND)

Bike - Only({<GROUP = {"Bike"}>}BRAND)

Airplane - Only({<GROUP = {"Airplane"}>}BRAND)

 

Thanks,

Ashutosh

virus190
Contributor
Contributor
Author

thank you very much for the quick help, i only want to do some of the values, so the second is good and i only have only 1 value per id, so this works for me perfectly!