Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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);

PrashantSangle

please closed the thread if you get the answer.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
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.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂