Qlik Community

Qlik Brasil

Group community for Brazil users. discussion only in Portuguese.

Highlighted
paulomulato
Not applicable

Data x Indice

Senhores, voces poderiam me ajudar no seguinte problema, tenho uma tabela fato com a data de faturamento, gostaria de incluir uma coluna auxiliar em que para data eu adicionasse um indice, esse indice começaria sempre com 1 para meses diferentes.  exemplo abaixo.

  

Dt NotaIndice
02/05/20161
03/05/20162
04/05/20163
05/05/20164
06/05/20165
07/05/20166
09/05/20167
10/05/20168
11/05/20169
12/05/201610
Tags (1)
13 Replies
karmariv82
Not applicable

Re: Data x Indice

Hi PauloRoge,

Maybe you could use the Peek function. Please check the attached qvw.

Regards,

-- Karla

sunny_talwar
Not applicable

Re: Data x Indice

Not sure what you want, but try one of these:

Table:

LOAD Month(Date) as Month,

  Date,

AutoNumber(Month(Date)) as Indice,

  AutoNumber(RowNo(), Month(Date)) as Indice1;

LOAD Date(MakeDate(2013, 12, 31) + RecNo()) as Date

AutoGenerate Today() - MakeDate(2013, 12, 31) + RecNo();

Capture.PNG

paulomulato
Not applicable

Re: Data x Indice

Thank sunny , it worked.

paulomulato
Not applicable

Re: Data x Indice

Hi Sunny, I have a doubt, as I do with a table that I have repeated lines for the same date and with different years?

sunny_talwar
Not applicable

Re: Data x Indice

You can try this with MonthName function, instead of Month function

Table:

LOAD Month(Date) as Month,

  Date,

AutoNumber(MonthName(Date)) as Indice,

  AutoNumber(RowNo(), MonthName(Date)) as Indice1;

LOAD Date(MakeDate(2013, 12, 31) + RecNo()) as Date

AutoGenerate Today() - MakeDate(2013, 12, 31) + RecNo();

paulomulato
Not applicable

Re: Data x Indice

It did not work , as it puts the image AutoNumber per month and not per day.


Imagem1.png

paulomulato
Not applicable

Re: Data x Indice

follow script:

NBase_Indice:

LOAD

    [Dt Nota],

     count([Dt Nota]) as total_data,

     AutoNumber(MonthName([Dt Nota])) as Indice_Data

FROM

(qvd) Group by [Dt Nota];

sunny_talwar
Not applicable

Re: Data x Indice

Check the attached

Capture.PNG

sunny_talwar
Not applicable

Re: Data x Indice

May be this:

NBase_Indice:

LOAD [Dt Nota],

    Count([Dt Nota]) as total_data,

   AutoNumber(RowNo(), MonthName([Dt Nota])) as Indice_Data

FROM (qvd)
Group by [Dt Nota];