Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 Nota | Indice |
02/05/2016 | 1 |
03/05/2016 | 2 |
04/05/2016 | 3 |
05/05/2016 | 4 |
06/05/2016 | 5 |
07/05/2016 | 6 |
09/05/2016 | 7 |
10/05/2016 | 8 |
11/05/2016 | 9 |
12/05/2016 | 10 |
Hi PauloRoge,
Maybe you could use the Peek function. Please check the attached qvw.
Regards,
-- Karla
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();
Thank sunny , it worked.
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?
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();
It did not work , as it puts the image AutoNumber per month and not per day.
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];
Check the attached
May be this:
NBase_Indice:
LOAD [Dt Nota],
Count([Dt Nota]) as total_data,
AutoNumber(RowNo(), MonthName([Dt Nota])) as Indice_Data
FROM
Group by [Dt Nota];