Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
I am having one inline table like below
load * inline [
month,org
april, a
may,b
jun,c
];
now my aim is need to load the month data for each org.
ex: i want april month data for a ,b and c org and alos may month data for a,b and c org like ....
how to write the for loop for the same please help me on the same?
Hi Siva,
You dodn't need loop for achive this.
base:
load * inline [
month,org
april, a
may,b
jun,c
];
org:
Load org Resident base;
left join(org)
Load month Resident base;
drop table base;
G.
Hi,
try this:
table:
load * inline [
month,org
april, a
may,b
jun,c
];
for each month in FieldValueList('month')
LOAD '$(month)' as month, org Resident table;
NEXT month
try this ,also @youfas
table:
load * inline [
month,org
april, a
may,b
jun,c
];
For i = 0 to FieldValueCount('month')
LET vmonth = Peek('month',$(i),table);
LOAD '$(vmonth)' as month, org Resident table;
NEXT i
Thanks,
that is working fine!
If will have many fields in my inline load in that case is it possible to get the data ?
you're welcome, if you add another field for example, you will have the same number of lines with the data of that new field,
example, you add another field named test, like this:
table:
load * inline [
month,org,test
april, a, test1
may,b, test2
jun,c, test3
];
you will have this:
april | a | test1 |
april | b | test2 |
april | c | test3 |
jun | a | test1 |
jun | b | test2 |
jun | c | test3 |
may | a | test1 |
may | b | test2 |
may | c | test3 |
if yo need something else you need to change the script until you get what you want