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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
alkesh_sharma
Creator III
Creator III

Error in Set Expression

Hello All,

I am Using the following Expression:

=Sum({<[Revenue.Invoice Date] = {$(vCutoffDate)}>} [Revenue.Invoice Amount]/vMillion)

Its returning me an Error: ERROR in SET MODIFIER, ',' or ')' Expected.

Need Help..

27 Replies
stabben23
Partner - Master
Partner - Master

if u comapare DD-MM-YYYY([Revenue.Invoice Date]) with your vCutoffDate DD-MM-YY you wont have a match.

jyothish8807
Master II
Master II

Hi Alkesh,

Can you share the expression you are using in the variable? It will be helpful .

Regards

KC

Best Regards,
KC
alkesh_sharma
Creator III
Creator III
Author

Yes, Its ''DD-MM-YY' only, I did a typing mistake in the above reply..

stabben23
Partner - Master
Partner - Master

Try this instead {'=(Date(vCutoffDate))'}

tcullinane
Creator II
Creator II

Try
if([Revenue.InvoiceDate] = vCutOffDate,Revenue.InvoiceAmount)

may give you more information on where its going wrong

could also show both Invoice date and vCutOffDate in the table along with the if statement.

Change both their default number type to decimal also, as this is what the comparison is on, the number value not the display value.

This can cause issue if a time component is still in a date value so make sure to floor() a date when only the date is important and remove the time or decimal component of the day.

alkesh_sharma
Creator III
Creator III
Author

Figures it out.. there was some date formatting problems. Thanx for your suggestion guys

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

This expression in a list box

=$(vCutoffDate)


expands to

=02-11-11


which QV interprets as 2 minus 11 minus 11 = -20


This is because the $() expansion is a text expansion only. It has not concept of data type. Compare that with

='$(vCutoffDate)' // ie with quotes


expands to

='02-11-11'


which Qv might interpret as a date (if DD-MM-YY is the default date format on your system). Otherwise, use


=Date(Date#('$(vCutoffDate)', 'DD-MM-YY'), 'DD-MM-YYYY') in a text box, or


....{"$(=Date(Date#(vCutoffDate, 'DD-MM-YY'), 'DD-MM-YYYY'))"} in a set expression filter.


HTH

Jonathan


Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
alkesh_sharma
Creator III
Creator III
Author

Thanx Jonathan,

This was indeed helpful.