Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

eduardo_dimperi
Valued Contributor II

LEFT JOIN USING WHILE

Hi,

I'm trying this, but with no sucess. Please i need some help.

ANALISE_TMP:

LOAD

  ID_LEITURA,

    NAME_SYSTEM,

    NAME_GROUP,

    NEIGHB_SYSTEM,

    CITY_SYSTEM,

    OID_METER,

    NAME_TYPE_METER,

    TYPE_CONSTANT,

    NAME_UC,

    ADDRESS_BLOCK_UC,

    DATE_READ

  RESIDENT TMP2;

Set dia=0

Do while dia<=2   

   

left join (ANALISE_TMP)

LOAD

    OID_METER,

    VALUE_READ * TYPE_CONSTANT AS CONSUMODIA$dia

RESIDENT TMP2

where FLOOR(DATE_READ)=FLOOR(TODAY()-$dia);

Let dia=dia+1;

LooP

//Ocorreram os seguintes erros:

//Script line error:: return

---

//O erro ocorreu aqui:

//LooP

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: LEFT JOIN USING WHILE

May be this:

left join (ANALISE_TMP)

LOAD

    OID_METER,

    VALUE_READ * TYPE_CONSTANT AS CONSUMODIA$(dia)

RESIDENT TMP2

where FLOOR(DATE_READ)=FLOOR(TODAY()-$(dia));

6 Replies
MVP
MVP

Re: LEFT JOIN USING WHILE

May be this:

left join (ANALISE_TMP)

LOAD

    OID_METER,

    VALUE_READ * TYPE_CONSTANT AS CONSUMODIA$(dia)

RESIDENT TMP2

where FLOOR(DATE_READ)=FLOOR(TODAY()-$(dia));

Re: LEFT JOIN USING WHILE

Hi Eduardo, try using the $-expansion with parenthesys:

left join (ANALISE_TMP)

LOAD

    OID_METER,

    VALUE_READ * TYPE_CONSTANT AS CONSUMODIA$(dia)

RESIDENT TMP2

where FLOOR(DATE_READ)=FLOOR(TODAY()-$(dia));

Let dia=dia+1;

LooP

Re: LEFT JOIN USING WHILE

You always faster.

eduardo_dimperi
Valued Contributor II

Re: LEFT JOIN USING WHILE

Wow, was really fast.

Thank you for that Ruben, but still not working.

Set dia=0

Do while dia<=2   

   

left join (ANALISE_TMP)

LOAD

  OID_METER,

    VALUE_READ * TYPE_CONSTANT AS CONSUMODIA$(dia)

RESIDENT TMP2

where FLOOR(DATE_READ)=FLOOR(TODAY()-$(dia))

ORDER BY OID_METER,DATE_READ DESC;

Let dia=dia+1;

LooP

I get the same error as before

eduardo_dimperi
Valued Contributor II

Re: LEFT JOIN USING WHILE

Indeed lol

eduardo_dimperi
Valued Contributor II

Re: LEFT JOIN USING WHILE

Guys I think i have resolve the problem.

I miss to put a ; after set my variable dia.

But thank you some much

Community Browser