Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I want to make custom sort.
My dimension is
=if(='Shop specific','Shop',if(='Browse','Shop',if(='Learn pricing','Shop',
if(='Check order','Everything else',if(='Manage account','Everything else',if(='Support','Everything else',
if(='Make purchase','Make a purchase')))))))
I want Make a purchase --1
Shop --2
Everything else ---3
How to do it easy? in Load script use rank or use expression in sort?
Thanks,
Try
=if(='Shop specific',dual('Shop',2),if(='Browse',dual('Shop',2),if(='Learn pricing',dual('Shop',2),
if(='Check order',dual('Everything else',3),if(='Manage account',dual('Everything else',3),if(='Support',dual('Everything else',3),
if(='Make purchase',dual('Make a purchase',1))))))))
and sort numeric.
edit: Since since seems to be a static mapping, I would suggest that you create an additional field in your database in the LOAD for field , not a calculated dimension (you can use a almost identical syntax as above, or a mapping load for ...
try adding the expression in the sort by Expression
Hi Alan,
I do usually, but now I coded each tag to custom. It doesn't work.
Have you tried Match
MATCH(Fieldname,'Value1','Value2','Value3','Value4')
I tried
if(WildMatch(,'Shop specific*'),2,
if(WildMatch(,'Browse*'),3,
if(WildMatch(,'Learn pricing*'),4,
if(WildMatch(,'Check order*'),5,
if(WildMatch(,'Manage account*'),6,
if(WildMatch(,'Support*'),7,
if(WildMatch(,'Make purchase*'),1)))))))
Try
=if(='Shop specific',dual('Shop',2),if(='Browse',dual('Shop',2),if(='Learn pricing',dual('Shop',2),
if(='Check order',dual('Everything else',3),if(='Manage account',dual('Everything else',3),if(='Support',dual('Everything else',3),
if(='Make purchase',dual('Make a purchase',1))))))))
and sort numeric.
edit: Since since seems to be a static mapping, I would suggest that you create an additional field in your database in the LOAD for field , not a calculated dimension (you can use a almost identical syntax as above, or a mapping load for ...
Hello Vladimir,
One trick you might want to try out is using a LOAD * Inline statement to predefine the order in which the field values should always be presented, especially if these values are static.
Hence, prior to loading your data from the external source, add this part to your script:
tmp_A:
LOAD * Inline [
A
Make purchase
Shop specific
Browse
Learn pricing
Check order
Manage account
Support];
The naming of the "A" field is important, it should be the same as the way you refer to it once your loading process is done.
At the end of your script the tmp_A table is no longer necessary, the order has been established. You may drop the tmp_A table as such:
DROP Table tmp_A;
Once this is achieved, you can now start to use a fancy ordering method called "Load Order: Original", as illustrated below:
Once that option is selected, your dimension values shall be presented in the order they were first read into memory. Furthermore, using this option on dimensions with a lot a values is very fast!
Regards,
Philippe