Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
First post here, this place has helped me a lot by searching and reading only in the past few weeks.
I think I got a question here that is hard to search for.
Question: Can I run a logic test on a mapped field name within the same script.
/*Example section in a standard Load & From script:
Load
...
applyMap(LookUpName, Customer_ID, ' ') as [New Name]
If([New Name] = ' ', 'Exclude', 'Include') as [Name Filter]
...
From...
*/
In my results, [New Name] worked well as it returned the proper mapped name.
But, [Name Filter] just returned blank for all results even [New Name] rows that are not blank.
Can I call a mapped field name this way within the same script?
Appreciate this big time, been scratching my head for two hours on this...
You can't refer a field in the load statement which is created/named in the same load statement. You can rather try like:
applyMap(LookUpName, Customer_ID, ' ') as [New Name]
If(applyMap(LookUpName, Customer_ID, ' ') = ' ', 'Exclude', 'Include') as [Name Filter]
You can't refer a field in the load statement which is created/named in the same load statement. You can rather try like:
applyMap(LookUpName, Customer_ID, ' ') as [New Name]
If(applyMap(LookUpName, Customer_ID, ' ') = ' ', 'Exclude', 'Include') as [Name Filter]
No you cant, no renames inside a LOAD are available inside for other calculations inside the load. You can however do a preceding load like this.
Table:
LOAD
*,
If([New Name] = ' ', 'Exclude', 'Include') as [Name Filter]
;
Load
...
applyMap(LookUpName, Customer_ID, ' ') as [New Name]
...
From...
Just tried out in QKV, worked really well, learnt something new today.
Thank you champs.
Gavin.