Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
eduardo_dimperio
Specialist II
Specialist II

Min() with a date

Hi,

I'm trying to get the min condition date from this table:

Set Data=10/02/2018;

LET Mes=Date(Data,'MM/YYYY');

For vDias = 0 to 2

     Data=Date(Data-$(vDias));

     Mes=Date(Data,'MM/YYYY');

     For vMeses = 0 to 6

//***************************************************

Exibicao:

LOAD DISTINCT

    OID_METER,

    OID_SYSTEM,

    OID_GROUP,

    NAME_SYSTEM,

    CONS0,

   '$(Data)' AS DATA_EXTRACAO,

   ('$(Mes)') AS MES_ANO_EXTRACAO

FROM [lib://Dados/MI/Leituras/Consumo/Condominios/FATURA/FATURA_EXIBICAO_$(vCarga).qvd](qvd);

//***************************************************

     Data=AddMonths(Data,-1);

     Mes=Date(Data,'MM/YYYY');

     Next

Set Data=10/02/2018;

Mes=Date(Data,'MM/YYYY');

Next

So, in chart MES_ANO_EXTRACAO appears ok to me, but when i try  Min(MES_ANO_EXTRACAO) i got null


set_analysis.JPG

1 Solution

Accepted Solutions
eduardo_dimperio
Specialist II
Specialist II
Author

Hi,

with this code it works

Exibicao:

LOAD DISTINCT

    OID_METER,

    OID_SYSTEM,

    OID_GROUP,

    NAME_SYSTEM,

    CONS0,

'$(Data)' AS DATA_EXTRACAO,

  DATE(DATE#('$(Mes)','MM/YYYY'),'MM/YYYY') AS MES_ANO_EXTRACAO

FROM [lib://Dados/MI/Leituras/Consumo/Condominios/FATURA/FATURA_EXIBICAO_$(vCarga).qvd](qvd);

View solution in original post

4 Replies
eduardo_dimperio
Specialist II
Specialist II
Author

Hi,

with this code it works

Exibicao:

LOAD DISTINCT

    OID_METER,

    OID_SYSTEM,

    OID_GROUP,

    NAME_SYSTEM,

    CONS0,

'$(Data)' AS DATA_EXTRACAO,

  DATE(DATE#('$(Mes)','MM/YYYY'),'MM/YYYY') AS MES_ANO_EXTRACAO

FROM [lib://Dados/MI/Leituras/Consumo/Condominios/FATURA/FATURA_EXIBICAO_$(vCarga).qvd](qvd);

View solution in original post

PrashantSangle

please closed the thread if you get the answer.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
eduardo_dimperio
Specialist II
Specialist II
Author

I think better exclude the question instead mark right answer to myself

PrashantSangle

mark your answer correct , because it will help other qliker to find solution.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.