Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
suniljain
Master
Master

Is it possible to give aliase name by evaluating expression ?.

is it possible to give aliase name by evaluating expression.

E.g

                   [FOR M]  as Date(AddMonths(Today(),0),'MMM-YYYY') ,

                   [FOR M+1]  as Date(AddMonths(Today(),1),'MMM-YYYY') ,

                   [FOR M+2]  as Date(AddMonths(Today(),2),'MMM-YYYY') ,

                   [FOR M+3]  as Date(AddMonths(Today(),3),'MMM-YYYY')

5 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     Yes it is possible.

     Try this code.

     

let XYZ = date(AddMonths(Today(),0),'MMM-YYYY');

Inline:
LOAD * INLINE [
    Name
    a
    b
    c
    d
    e
    f
];

Data:
load Name as '$(XYZ)'
Resident Inline;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
suniljain
Master
Master
Author

This logic donot work in my scenario

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Whats your scenario..?

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

The logic  of going via a variable should work fine. You just need to remove the single quotes from that example. Also, the resident load is not required as you could do the alias on the inline load.

To get three different field names you just need to set three different variables.

Remember to wrap the variables in square brackets if there is the possibility of spaces in the variable.

- Steve

suniljain
Master
Master
Author

Thanks a Lot Steve.

Its Resolved.