Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Filtering records based on created dimension

Hello everyone,

New dimension Freight 'TYPE' has been created based on the number of distinct Customer Groups on
Section Type 'OUT'. And it works just fine. However some freights have only section 'BH' like freight #5 in the attached
model.

I would like to classify such freights under following TYPE : 'Not_from_DC'  and be able to select also those.

Anyone knows knows how to solve this?

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Please check the attached one.

-Celambarasan

View solution in original post

9 Replies
Qrishna
Specialist III
Specialist III

This way?

Capture.PNG

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi Adam,

How about this?

1.png

See my calculated condition

Anonymous
Not applicable
Author

Wrong answer, if you click on No_from_DC it does not do anything, , But if you click on mixed'' then it selects only mixed freights , the same with dedicated- that part has been done

This is not an easy question

Anonymous
Not applicable
Author

yes, but try to click on Not_from_DC and when you see only the record  Freight#5 then it is probably a good solution

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Please check the attached one.

-Celambarasan

Qrishna
Specialist III
Specialist III

See attached.

Capture.PNG

maxgro
MVP
MVP

If I understand you want to group the not OUT records under Not_from_DC

Change to your script in bold


datld:

load * Inline [

Freight#,SectionType,CustomerGroup,COST

1,OUT,A,50

1,OUT,B,100

1,BH,X,150

2,OUT,A,100   

2,BH,Z,100

3,OUT,A,100

3,BH,B,200

4,OUT,B,300

4,OUT,A,100

5,BH,S,50

]; 

nwtb:

load

  count( distinct(CustomerGroup)) as GroupCnt,

  Freight#,

SectionType

Resident datld

//Where SectionType='OUT'

Group by Freight#,

SectionType;

Left Join(datld)

load

  if(SectionType='OUT',

  if(GroupCnt>1,'Mixed','Dedicated'),

  'Not_from_DC'

  ) as Type,

  Freight#

Resident nwtb; 

Anonymous
Not applicable
Author

Hi Krishna.

Your solution is also good.

Thanks

Adam

Anonymous
Not applicable
Author

Thanks Celembarasan!

But , what would be a solution in  cases when there is a section OUT, but the cost = 0 or cost is empty

Such freights I would like to classify as 'not_from_dc' as well.

Thanks in advance for your help.