Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
jaimeeduardo_gc
Contributor II
Contributor II

set analysis with value of dimension

Hi all!!

I have this data table:

datekey_ymidid_antcentro_costoscve_skuInicialFinal
202009202009|4101|0000000185202010|4101|000000018541010000000185100
202010202010|4101|0000000185202011|4101|00000001854101000000018560
202011202011|4101|0000000185202012|4101|00000001854101000000018560

 

and I need that the expression 'final' shows the sum of expresion Inicial where id = id_ant, something like this:

datekey_ymidid_antcentro_costoscve_skuInicialFinal
202009202009|4101|0000000185202010|4101|000000018541010000000185106
202010202010|4101|0000000185202011|4101|00000001854101000000018566
202011202011|4101|0000000185202012|4101|00000001854101000000018560

 

I try with this expression: sum({<id={"=id_ant"}>} Inicial) but it doesn't work.

could anyone help me please?

Thanks a lot!!

 

Labels (2)
1 Reply
MayilVahanan

Hi @jaimeeduardo_gc 

Both id and id_ant values are not equal in the same row. so that, its gives zero value. 

Based on ur sample, its looks like , Id_ant value is next line Id values? if so, you can try like below

LOAD *, Peek(id_ant) as id_Ant1 INLINE [
datekey_ym, id, id_ant, centro_costos, cve_sku, Inicial, Final
202009, 202009|4101|0000000185, 202010|4101|0000000185, 4101, 0000000185, 10, 0
202010, 202010|4101|0000000185, 202011|4101|0000000185, 4101, 0000000185, 6, 0
202011, 202011|4101|0000000185, 202012|4101|0000000185, 4101, 0000000185, 6, 0
];

Exp: sum({<id={"=id=id_Ant1"}>} Inicial)

MayilVahanan_0-1606368163941.png

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.