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: 
paulomulato
Creator
Creator

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
Labels (1)
13 Replies
Anonymous
Not applicable

Hi PauloRoge,

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

Regards,

-- Karla

sunny_talwar

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
Creator
Creator
Author

Thank sunny , it worked.

paulomulato
Creator
Creator
Author

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

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
Creator
Creator
Author

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


Imagem1.png

paulomulato
Creator
Creator
Author

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

Check the attached

Capture.PNG

sunny_talwar

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];