# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Contributor III

## set analysis with expression

exp1:

=sum(if(REAL_PACKS.LIB_TYPE_PACK=OBJ_PACK.TYPEPACK and REAL_PACKS.PROD_PACK=1,REAL_PACKS.NOMBRE_PACK))

for exp i want to calculated cumulative Nombre pack, i use this exp

exp2:

=sum({<OBJ_PACK.TYPEPACK={REAL_PACKS.LIB_TYPE_PACK} , REAL_PACKS.PROD_PACK={"1"},YEAR = {\$(=Max(YEAR))}, MONTH, MONTHNUM = {"<= \$(=MAX(MONTHNUM))"} ,SITUATION_PRODUIT>} REAL_PACKS.NOMBRE_PACK)

this exp shows 0,

and when i remove OBJ_PACK.TYPEPACK={REAL_PACKS.LIB_TYPE_PACK}

this exp shows result but it's not correct

1 Solution

Accepted Solutions
MVP

## Re: set analysis with expression

What if you do this

=Sum({<REAL_PACKS.PROD_PACK = {1}, YEAR = {\$(=Max(YEAR))}, MONTH, MONTHNUM = {"<= \$(=MAX(MONTHNUM))"} , SITUATION_PRODUIT>} If(OBJ_PACK.TYPEPACK = REAL_PACKS.LIB_TYPE_PACK, REAL_PACKS.NOMBRE_PACK))

2 Replies
MVP

## Re: set analysis with expression

What if you do this

=Sum({<REAL_PACKS.PROD_PACK = {1}, YEAR = {\$(=Max(YEAR))}, MONTH, MONTHNUM = {"<= \$(=MAX(MONTHNUM))"} , SITUATION_PRODUIT>} If(OBJ_PACK.TYPEPACK = REAL_PACKS.LIB_TYPE_PACK, REAL_PACKS.NOMBRE_PACK))

Contributor III

## Re: set analysis with expression

hahah thank you sunny