
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
calculo con peek o previus no me funciona
hola , necesito calcular el nuevo valor de la celda , pero no estoy logrando hacerlo funcionar , me podran ayudar ?
A | B | C | D | E | F | ||||
1 | ID | Fecha aumento | Nombre | previo_incremento | Incremento | Indice Cemep | |||
2 | 40 | 1/2/2019 | ASOCIART ART | 9,9 | 20,0 | 120,0 | |||
3 | 41 | 1/9/2019 | ASOCIART ART | 20,0 | 15,0 | 0,0 | calculate | F2+F2*E3/100 | |
4 | 42 | 1/4/2020 | ASOCIART ART | 15,0 | 20,0 | 0,0 | |||
5 | 43 | 1/10/2020 | ASOCIART ART | 20,0 | 20,0 | 0,0 | |||
6 | 44 | 1/6/2021 | ASOCIART ART | 20,0 | 20,0 | 0,0 | |||
7 | 45 | 1/9/2021 | ASOCIART ART | 20,0 | 25,0 | 0,0 | |||
8 | 46 | 1/3/2022 | ASOCIART ART | 25,0 | 15,0 | 0,0 | |||
9 | 47 | 1/8/2022 | ASOCIART ART | 15,0 | 20,0 | 0,0 | |||
10 | 48 | 1/11/2022 | ASOCIART ART | 20,0 | 15,0 | 0,0 | |||
11 | 49 | 1/12/2022 | ASOCIART ART | 15,0 | 15,0 | 0,0 | |||
12 | 50 | 1/3/2023 | ASOCIART ART | 15,0 | 25,0 | 0,0 | |||
13 | 51 | 1/7/2023 | ASOCIART ART | 25,0 | 25,0 | 0,0 | |||
14 | 52 | 1/10/2023 | ASOCIART ART | 25,0 | 25,0 | 0,0 |
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
gracias a todos , pero no se porque no funcionaba , lo exporte a QVD al trabajarlo en una app nueva funciona esta formula
If([indice_cemep] = 0,Peek([indice_cemep])+ Peek([indice_cemep])*(Incremento/100), [indice_cemep]) as [indice_cemep]
no se porque en la app principal me tomaba solo un campo después volvía a cero
en fin a esta lo escribo porfi alguno tiene el mismo problema
slds

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hola, tendrías que explicar mejor lo que quieres, podrías empezar contando lo que tienes, lo que quieres sacar, lo que has intentado y qué parte no funciona.
Saludos.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ruben , quiero construir un indice de aumento de todos los clientes ,logre crear el "indice cemep " base mediante esta formula
if(Nombre<>Previous(Nombre),RangeSum(100+Incremento),
en la misma formula quise completar los datos faltantes
Previous(indice_cemep) as previo_indice_cemep,
if(Nombre<>Previous(Nombre),indice_cemep,
RangeSum(peek(indice_cemep)+(peek(indice_cemep)+Incremento/100) ).
pero no responde de la manera querida
estoy acá :
ID | Fecha aumento | Nomenclador | previo_incremento | Incremento | Indice Cemep |
1 | 1/4/2019 | 110 | - | 10,0 | 110,0 |
2 | 1/7/2019 | 110 | 10,0 | 10,0 | 0,0 |
3 | 1/10/2019 | 110 | 10,0 | 10,0 | 0,0 |
4 | 1/11/2019 | 110 | 10,0 | 10,0 | 0,0 |
5 | 1/12/2019 | 110 | 10,0 | 10,0 | 0,0 |
6 | 1/4/2020 | 110 | 10,0 | 10,0 | 0,0 |
7 | 1/10/2020 | 45 | 10,0 | 50,0 | 150,0 |
8 | 1/8/2023 | 45 | 50,0 | 50,0 | 0,0 |
9 | 1/1/2019 | 169 | - | 5,0 | 105,0 |
10 | 1/5/2019 | 169 | 5,0 | 16,0 | 0,0 |
11 | 1/9/2019 | 169 | 16,0 | 4,5 | 0,0 |
12 | 1/10/2019 | 169 | 4,5 | 4,5 | 0,0 |
13 | 1/11/2019 | 169 | 4,5 | 4,5 | 0,0 |
14 | 1/12/2019 | 169 | 4,5 | 7,0 | 0,0 |
15 | 1/1/2020 | 169 | 7,0 | 8,0 | 0,0 |
16 | 1/6/2020 | 169 | 8,0 | 3,0 | 0,0 |
17 | 1/12/2020 | 169 | 3,0 | 10,0 | 0,0 |
18 | 1/3/2021 | 169 | 10,0 | 3,5 | 0,0 |
19 | 1/6/2021 | 169 | 3,5 | 8,0 | 0,0 |
20 | 1/8/2021 | 169 | 8,0 | 9,0 | 0,0 |
21 | 1/10/2021 | 169 | 9,0 | 9,0 | 0,0 |
22 | 1/2/2022 | 169 | 9,0 | 9,0 | 0,0 |
23 | 1/4/2022 | 169 | 9,0 | 9,0 | 0,0 |
24 | 1/6/2022 | 169 | 9,0 | 10,0 | 0,0 |
25 | 1/7/2022 | 169 | 10,0 | 10,0 | 0,0 |
26 | 1/8/2022 | 169 | 10,0 | 10,2 | 0,0 |
27 | 1/10/2022 | 169 | 10,2 | 10,4 | 0,0 |
28 | 1/12/2022 | 169 | 10,4 | 6,4 | 0,0 |
29 | 1/1/2023 | 169 | 6,4 | 5,9 | 0,0 |
30 | 1/2/2023 | 169 | 5,9 | 7,0 | 0,0 |
31 | 1/3/2023 | 169 | 7,0 | 6,9 | 0,0 |
32 | 1/4/2023 | 169 | 6,9 | 2,1 | 0,0 |
33 | 1/5/2023 | 169 | 2,1 | 4,3 | 0,0 |
34 | 1/6/2023 | 169 | 4,3 | 4,9 | 0,0 |
35 | 1/7/2023 | 169 | 4,9 | 7,6 | 0,0 |
36 | 1/8/2023 | 169 | 7,6 | 7,8 | 0,0 |
37 | 1/9/2023 | 169 | 7,8 | 4,4 | 0,0 |
38 | 1/10/2023 | 169 | 4,4 | 4,5 | 0,0 |
39 | 1/11/2023 | 169 | 4,5 | 9,9 | 0,0 |
40 | 1/2/2019 | 126 | 9,9 | 20,0 | 120,0 |
41 | 1/9/2019 | 126 | 20,0 | 15,0 | 0,0 |
42 | 1/4/2020 | 126 | 15,0 | 20,0 | 0,0 |
43 | 1/10/2020 | 126 | 20,0 | 20,0 | 0,0 |
44 | 1/6/2021 | 126 | 20,0 | 20,0 | 0,0 |
45 | 1/9/2021 | 126 | 20,0 | 25,0 | 0,0 |
46 | 1/3/2022 | 126 | 25,0 | 15,0 | 0,0 |
47 | 1/8/2022 | 126 | 15,0 | 20,0 | 0,0 |
48 | 1/11/2022 | 126 | 20,0 | 15,0 | 0,0 |
49 | 1/12/2022 | 126 | 15,0 | 15,0 | 0,0 |
50 | 1/3/2023 | 126 | 15,0 | 25,0 | 0,0 |
51 | 1/7/2023 | 126 | 25,0 | 25,0 | 0,0 |
52 | 1/10/2023 | 126 | 25,0 | 25,0 | 0,0 |
53 | 1/9/2019 | 137 | - | 25,0 | 125,0 |
54 | 1/10/2019 | 137 | 25,0 | 10,0 | 0,0 |
55 | 1/3/2020 | 137 | 10,0 | 20,0 | 0,0 |
56 | 1/4/2021 | 137 | 20,0 | 25,0 | 0,0 |
57 | 1/10/2021 | 137 | 25,0 | 20,0 | 0,0 |
58 | 1/3/2022 | 137 | 20,0 | 15,0 | 0,0 |
59 | 1/3/2022 | 137 | 15,0 | 15,0 | 0,0 |
60 | 1/8/2022 | 137 | 15,0 | 20,0 | 0,0 |
61 | 1/11/2022 | 137 | 20,0 | 15,0 | 0,0 |
62 | 1/12/2022 | 137 | 15,0 | 15,0 | 0,0 |
63 | 1/3/2023 | 137 | 15,0 | 25,0 | 0,0 |
64 | 1/7/2023 | 137 | 25,0 | 25,0 | 0,0 |
65 | 1/10/2023 | 137 | 25,0 | 25,0 | 0,0 |
y quiero llegar a algo similar a esto .
Fecha | IPC Mensual | ipc_nivel_general_nacional3 |
1/12/2016 | ,0 | 100,0 |
1/1/2017 | 1,6 | 101,6 |
1/2/2017 | 2,1 | 103,7 |
1/3/2017 | 2,4 | 106,1 |
1/4/2017 | 2,7 | 109,0 |
1/5/2017 | 1,4 | 110,5 |
1/6/2017 | 1,2 | 111,8 |
1/7/2017 | 1,7 | 113,8 |
1/8/2017 | 1,4 | 115,4 |
1/9/2017 | 1,9 | 117,6 |
1/10/2017 | 1,5 | 119,4 |
1/11/2017 | 1,4 | 121,0 |
1/12/2017 | 3,1 | 124,8 |
1/1/2018 | 1,8 | 127,0 |
1/2/2018 | 2,4 | 130,1 |
1/3/2018 | 2,3 | 133,1 |
1/4/2018 | 2,7 | 136,8 |
1/5/2018 | 2,1 | 139,6 |
1/6/2018 | 3,7 | 144,8 |
espero se entienda lo que quiero hacer , básicamente es ir armado un indice propio por cliente

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hola. Asumiendo que IPC Mensual es un dato que ya está presente en la fuente de datos, puedes hacer:
Load
Fecha,
[IPC Mensual],
previous(ipc_nivel_general_nacional3) + [IPC Mensual] as ipc_nivel_general_nacional3
from <fuente de datos>
order by Fecha;
Espero que sirva.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
gracias por tu respuesta , pero esa tabla a esta completa la de IPC , era solo de ejemplo , necesito completar la table de arriba donde necesito crear un indice por cliente no me esta funcionando
gracias por tu tiempo

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hola, no estoy de la fórmula a usar, pero cargando la primera tabla con un inline llego a algo cercano a lo que quieres llegar, la cuestión es que hace el incremento, luego lo puedes ajustar.
Datos:
LOAD *,
If(Nomenclador<>Previous(Nomenclador)
,100+Incremento
,RangeSum(peek(indice_cemep),((peek(indice_cemep)+Incremento)/100))
)as indice_cemep
Resident tmpDatos
Order By Nomenclador,[Fecha aumento]
;
Por lo general las comparativas con peek y previous necesita usar los mismos campos en el order by.
El 'true' del primer if sería el que pone el valor inicial de cada serie y el 'false' el que usa el propio campo que se está calculando (y puede que otros auxiliares) para hacer el incremento.
Saludos.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
gracias a todos , pero no se porque no funcionaba , lo exporte a QVD al trabajarlo en una app nueva funciona esta formula
If([indice_cemep] = 0,Peek([indice_cemep])+ Peek([indice_cemep])*(Incremento/100), [indice_cemep]) as [indice_cemep]
no se porque en la app principal me tomaba solo un campo después volvía a cero
en fin a esta lo escribo porfi alguno tiene el mismo problema
slds
