Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
This way?
Hi Adam,
How about this?
See my calculated condition
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
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
Hi,
Please check the attached one.
-Celambarasan
See attached.
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;
Hi Krishna.
Your solution is also good.
Thanks
Adam
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.