Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

souadouert
Contributor III

set analysis problem

I have a problem with an expression set analysis, I want this test

dituationdate=(maxyear)-1 '&-12'

-->sum({<SITUATION_PRODUIT={$(=Max(YEAR)-1)&"-12"}>}REAL_TITRES.ENCOURS_TITRES)

It does not work always show the expression in red

1 Solution

Accepted Solutions
MVP
MVP

Re: set analysis problem

So you want to create something like '2016-12' ?

Try

sum({<SITUATION_PRODUIT={"$(=(Max(YEAR)-1) & '-12')"} >} REAL_TITRES.ENCOURS_TITRES)

8 Replies
roharoha
Valued Contributor III

Re: set analysis problem

why do you need dituationdate, but use SITUATION_PRODUIT ?

MVP
MVP

Re: set analysis problem

So you want to create something like '2016-12' ?

Try

sum({<SITUATION_PRODUIT={"$(=(Max(YEAR)-1) & '-12')"} >} REAL_TITRES.ENCOURS_TITRES)

roharoha
Valued Contributor III

Re: set analysis problem

Im not sure if this makes any difference as long as there are no spaces within the search string?!?

I don't trust in the syntax checker

I just tried it:

LOAD * INLINE [

    F1

    012016

    022016

];

--> this works even without quotes:

But as soon as there's a "-" a space or any other "special sign" in the search string you'll need single or double quotes.

So I admit I was wrong...

MVP
MVP

Re: set analysis problem

There should be a difference, since in the OP, the dollar sign expansion stops after -1.

The concatenation thereafter is not a valid syntax.

souadouert
Contributor III

Re: set analysis problem

i used this expression ,But the result is always null

MVP
MVP

Re: set analysis problem

How do the values of field SITUATION_PRODUIT look like?

For example,post a screenshot of a list box.

souadouert
Contributor III

Re: set analysis problem

thank y Stefan , i fixed the problem

souadouert
Contributor III

Re: set analysis problem

thank y Robin i fixed the problem , hank y for yr help