Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

Hi all,

I am trying to do the following formula

vVolumeType = 0 or 1 depending on one button

vVolumeTypeText = if($(vVolumeType), 'Volume hL', 'Volume Pallets')

Both of these two formulas work perfectly, but when I put it in a Set Analysis shows the title error.

sum({<Indicador={$(vVolumeTypeText)}>} Valor)

Although the following configuration works:

sum({<Indicador={'Volume hL'}>} Valor) or this configuration sum({<Indicador={'Volume Pallets'}>} Valor)

and I do not know what to do.

If anyone could help me I would be appreciated.

Regards,

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Check this may be?

View solution in original post

9 Replies
ahaahaaha
Partner - Master
Partner - Master

May be

sum({<Indicador={$(=vVolumeTypeText)}>} Valor)

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try putting an = character in front of the expression in the variable: =if($(vVolumeType), 'Volume hL', 'Volume Pallets')

And put the dollar expansion in single quotes: sum({<Indicador={'$(vVolumeTypeText)'}>} Valor)


talk is cheap, supply exceeds demand
hector_munoz
Specialist
Specialist

Hi Bruno,

Try the following:

=Sum({<Indicador={$(#vVolumeTypeText)}>} Valor)

Regards,

H

zebhashmi
Specialist
Specialist

is it a typo that you do not have complete logic check

vVolumeTypeText = if($(vVolumeType), 'Volume hL', 'Volume Pallets')


it should be


vVolumeTypeText = if($(vVolumeType) = 1, 'Volume hL', 'Volume Pallets')

Not applicable
Author

Hi guys,

Thanks a lot for the answers. I tried the three of them and anyone of then works:

  • sum({<Indicador={$(=vVolumeTypeText)}>} Valor) is still have the same error
  • =if($(vVolumeType), 'Volume hL', 'Volume Pallets')this formula works only without the = sign (if I put it this formula does not work anymore)
  • =Sum({<Indicador={$(#vVolumeTypeText)}>} Valor)does not work too even with the = sign.
  • I tried this too vVolumeTypeText = if($(vVolumeType) = 1, 'Volume hL', 'Volume Pallets'), but is having the same error.

I will try send a mock.



Not applicable
Author

Hi guys,

I put a link for an mock here:

mockt.qvw

Regards,

sudeepkm
Specialist III
Specialist III

could you please try like below:

in your Variable Overview:

vVolumeTypeText

=if($(vVolumeType) = 1, 'Volume hL', 'Volume Pallets')

vVolume_error

Sum({<Indicador={"$(vVolumeTypeText)"}>} Valor)

vishsaggi
Champion III
Champion III

Check this may be?

Not applicable
Author

Many thanks,

Works perfectly.

Even though I do not understood why. I saw that in some cases we use = in variable and $ and another, could you, please, tell me why this difference?