Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good afternoon everyone,
I have a problem trying to compile the results of several set variables in an INLINE table? Is it possible?
E.g.
LET IMRop15= FieldValue('Nume','1'); // It is correctly loaded
SET IMRop17=count({<Open_Year={'2017'}>} [IMR ID]); // It work on any other part but it is not loading
Tbl_IMRs_Abiertos:
Load * inline [
Yr,IMROp
2015,$(IMRop15),
2016,$(IMRop17)
];
Do you have any suggestions?
Regards
Victor,
Do something like this:
I would change the line:
SET IMRop17=count({<Open_Year={'2017'}>} [IMR ID]); // It work on any other part but it is not loading
because that's a set analysis count expression, and does not work on load statement, you would have to load the year into a table, to:
LoadCount:
Load
count([IMR ID]) as IMRop17
From [Whatever]
where Open_Year = 2017;
let IMRop = peek('IMRop17',0,'LoadCount');
Tbl_IMRs_Abiertos:
Load
IMROp as Yr,
$(IMRop15) as 2015,
$(IMRop) as 2016
Autogenerate(1);
As an example, I've used the below code:
x:
Load * Inline
[
Nume
1
];
IMRID:
Load * Inline
[
IMR ID,Open_Year
1,2012
2,2013
3,2014
4,2015
5,2017
6,2017
7,2016
8,2011
];
LoadCount:
Load
count([IMR ID]) as IMRop17
Resident IMRID
where Open_Year = 2017;
let IMRop = peek('IMRop17',0,'LoadCount');
LET IMRop15= FieldValue('Nume','1'); // It is correctly loaded
Tbl_IMRs_Abiertos:
Load
2015 as Yr,
$(IMRop15) as IMROp
Autogenerate(1);
Load
2016 as Yr,
$(IMRop) as IMROp
AutoGenerate(1);
drop tables LoadCount,IMRID,x;
Victor,
Do something like this:
I would change the line:
SET IMRop17=count({<Open_Year={'2017'}>} [IMR ID]); // It work on any other part but it is not loading
because that's a set analysis count expression, and does not work on load statement, you would have to load the year into a table, to:
LoadCount:
Load
count([IMR ID]) as IMRop17
From [Whatever]
where Open_Year = 2017;
let IMRop = peek('IMRop17',0,'LoadCount');
Tbl_IMRs_Abiertos:
Load
IMROp as Yr,
$(IMRop15) as 2015,
$(IMRop) as 2016
Autogenerate(1);
As an example, I've used the below code:
x:
Load * Inline
[
Nume
1
];
IMRID:
Load * Inline
[
IMR ID,Open_Year
1,2012
2,2013
3,2014
4,2015
5,2017
6,2017
7,2016
8,2011
];
LoadCount:
Load
count([IMR ID]) as IMRop17
Resident IMRID
where Open_Year = 2017;
let IMRop = peek('IMRop17',0,'LoadCount');
LET IMRop15= FieldValue('Nume','1'); // It is correctly loaded
Tbl_IMRs_Abiertos:
Load
2015 as Yr,
$(IMRop15) as IMROp
Autogenerate(1);
Load
2016 as Yr,
$(IMRop) as IMROp
AutoGenerate(1);
drop tables LoadCount,IMRID,x;
Felip, so many thanks for your help! It worked perfectly!
Glad it helped victor .