Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
julioarriaga
Creator II
Creator II

Is there a way assign an aggregated load statement to a variable?

Hi,

I want to know if there is any way of assigning an aggregated load statement to a variable just as in SQL

Thanks in advance.

Example:

DECLARE @vAnioCY INT=2018;

DECLARE @vECOCY FLOAT;

SET @vECOCY=(

SELECT AVG(ECO_Icalificacion)

FROM TH_EncuestaECO E

INNER JOIN Td_Tiempo T ON E.TPO_CFecha=T.TPO_CFecha

WHERE TPO_CAnioFiscal=@vAnioCY

)

1 Reply
balabhaskarqlik

ABC:

Load *;

SQL

SELECT AVG(ECO_Icalificacion) as Avg_Value

FROM TH_EncuestaECO E 

INNER JOIN Td_Tiempo T ON E.TPO_CFecha=T.TPO_CFecha 

WHERE TPO_CAnioFiscal=@vAnioCY;

Let vAvg = Peek('Avg_Value',0,'ABC');

Or

Let vAvg = Fieldvalue('Avg_Value',1);

Drop table ABC;

Use the above variable in different tables.