Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how to replace the '<=x<' symbol with '-' function using replace function?
its not working
new:
LOAD Region,
Year,
Products,
Sales,
class
([Sales],30) as Salesrange
FROM
(biff, embedded labels, table is Sheet1$);
A:
LOAD * , Replace(Salesrange,'<=x <' ,'-') as Sales_Range
Resident new;
DROP Table new;
Dual(Replace(Class(Sales,30),'<= x <','-'),Class(Sales,30)) as Salesrange
Replace(Salesrange,'<=x <' ,'-')
seems there is space in between x and <
use below
Replace(Salesrange,'<=x <' ,'-') as Sales_Range
Hi,
replacing the '<= x <' string using replace() is only one thing, because doing so you will get just a string, not a dual value like the class function generates. i.e. you would have to implement sorting expressions in charts to get the right order of you class dimension.
To avoid this issue, one solution could be:
tabSales:
LOAD *,
Dual(Replace(Class(Sales,30),'<= x <','-'),Class(Sales,30)) as Salesrange;
LOAD 'Region'&Ceil(Rand()*10) as Region,
2000+Floor(Rand()*15) as Year,
'Product'&Ceil(Rand()*10) as Products,
Money(Round(Rand()*300,0.01)) as Sales
AutoGenerate 100;
hope this helps
regards
Marco
Hi,
did any of the proposed solutions answer your question?
regards
Marco
yes thank macro