Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
nicolas_sinquin
New Contributor III

Error in set modifier ad hoc element list: ',' or ')' expected

Hye,

I define a variable :

Set VSecondeTranche =only(if(aggr(Rank(

Count(if ( $(vAnnee) = ANNEE_FH and $(vTypeAnnee) = TYPE_ANNEE ,Revenu_T1))

        /

    Count(Total if ( $(vAnnee) = ANNEE_FH and $(vTypeAnnee) = TYPE_ANNEE ,Revenu_T1))

        ,Revenu_T1)

        ,Revenu_T1)=2,Revenu_T1

            )

        );

That works fine when i put $(VSecondeTranche) (only 1 value).

But when i try

sum(

      {$<Revenu_T1 = {'=$(VSecondeTranche) '}

              >} MNT_NET_COJ_TOT

          )

I've the error message.

Thanks

1 Solution

Accepted Solutions

Re: Error in set modifier ad hoc element list: ',' or ')' expected

What if you do this

Sum({$<Revenu_T1 = {"$(=$(VSecondeTranche))"}>} MNT_NET_COJ_TOT)

9 Replies
YoussefBelloum
Esteemed Contributor

Re: Error in set modifier ad hoc element list: ',' or ')' expected

Hi,

try this:

sum({$<Revenu_T1 = {$(VSecondeTranche)}>} MNT_NET_COJ_TOT)

nicolas_sinquin
New Contributor III

Re: Error in set modifier ad hoc element list: ',' or ')' expected

same error...

Re: Error in set modifier ad hoc element list: ',' or ')' expected

How about this?

Sum({$<Revenu_T1 = {"$(=VSecondeTranche)"}>} MNT_NET_COJ_TOT)

nicolas_sinquin
New Contributor III

Re: Error in set modifier ad hoc element list: ',' or ')' expected

no error, but it give me 0

for information, it's a title, i set

$(VSecondeTranche) & '____' &

Sum({$<Revenu_T1 = {"$(=VSecondeTranche)"}>} MNT_NET_COJ_TOT)


and it's return

Capture.PNG


Re: Error in set modifier ad hoc element list: ',' or ')' expected

What if you do this

Sum({$<Revenu_T1 = {"$(=$(VSecondeTranche))"}>} MNT_NET_COJ_TOT)

nicolas_sinquin
New Contributor III

Re: Error in set modifier ad hoc element list: ',' or ')' expected

seems to be good !!

thanks !

Can you just explain why double quote and double $ ?

Re: Error in set modifier ad hoc element list: ',' or ')' expected

It depends on how the variable is declared, I am guessing your variable is without the equal sign? It just needed to be expanded, before the set analysis's dollar sign expansion. I am not completely sure if there is a sure shot way to decide this, but I usually try these two with variable and more often then not then work

1) {<FieldName = {"$(=vVar)"}>}

2) {<FieldName = {"$(=$(vVar))"}>}

nicolas_sinquin
New Contributor III

Re: Error in set modifier ad hoc element list: ',' or ')' expected

ok thanks.

my variable was defines like this :

Set VSecondeTranche = ......


I'll try this next time too !!


Edit : i think i've understand. It's about the same than difference betwenn set and let in load i gess.

nicolewallin
New Contributor

Re: Error in set modifier ad hoc element list: ',' or ')' expected

I'm getting a similar error with the following expression that aims to pull in a current AnnualProduct field selection that might include the "&" or "-" sign.  It works when I select an option without one of those symbols.  Any idea how to fix this?

(SUM({<AnnualYear={'$(=GetFieldSelections(AnnualYear))'},AnnualProduct={'$(=GetFieldSelections(AnnualProduct))'}>} AnnualSalesPremiumCurrentYear))

Community Browser