Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI
"A as B" that should be the easy way to rename right???
So why does this not work:
LOAD Name1,
Name2,
Name3,
Name4 as NameA,
if(NameA <50, '<50', if(Name A <100, '<100', if(Name A <5000, '<5000'))) .... as Example,
Name5,
Name 6,
....
....
Without "...as NameA", that is just using Name4 works fine.
Hi,
You LOAD the field Name4 as NameA but the loaded field is still Name4 until you complete the LOAD statement.
So in the next statement you can't refer to NameA because the LOAD statement is not completed.
Only after the completion of the LOAD sratement you can refer to NameA.
What you may do is Name4 as NaneA and in the next line Name4 as NameB etc
Your if statement can only be used with the field Name4 (or any other field you are loading).
Regards,
Gerrit
Check the If Statement
You have spaces after the named field like Name A it should be NameA
Change it and let me know if it helps
Regards
Al
Hi,
You LOAD the field Name4 as NameA but the loaded field is still Name4 until you complete the LOAD statement.
So in the next statement you can't refer to NameA because the LOAD statement is not completed.
Only after the completion of the LOAD sratement you can refer to NameA.
What you may do is Name4 as NaneA and in the next line Name4 as NameB etc
Your if statement can only be used with the field Name4 (or any other field you are loading).
Regards,
Gerrit
Nice spotted , but still it does not work. I just use these as examples as I use Danish words in my real script.
Can you share an example Mikael?
How did I miss that one!
Thx, that answered my Q why it did not work.
So what is the solution? I tried to make a separate Load before this one:
LOAD Name4 as NameA
...
LOAD Name1,
Name2,
Name3,
NameA,
if(NameA <50, '<50', if(Name A <100, '<100', if(Name A <5000, '<5000'))) .... as Example,
Name5,
Name 6,
....
....
No luck with that, lol.
Hi Mikael,
as Gerrit explian that Rename fields are not available untill load does not complete,
logically query executed like below:
From>> Where>> GroupBy >> Having clause >> Select>> OrderBy,
it mean you can use your rename fields in Orderby Clause, but not before that,,, so you should use real fields name not the renamed ones. like below:
LOAD Name1,
Name2,
Name3,
Name4 as NameA,
if(Name4 <50, '<50', if(Name4 <100, '<100', if(Name4 <5000, '<5000'))) .... as Example,
Name5,
Name 6,
..... and you can use field like Name A, either it should be Name_A or enclosed in brackets like [Name A]
Hope it helps..
Sorry I cannot share the specific data, if that is what you mean.
ok no problem, you have it sorted now so it's cool