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: 
rileymd88
Contributor III
Contributor III

Set Analysis Syntax Error

Hi,

I am trying to create an expression which is restricted to only sum when the calendar day in my data table equals the variable I have set via the load script called vLatestDay, however this is not working. Here is what I have in the expression:

Calendar day = Date dimension

vLatestDay = Variable date

WH Stock = The value I am trying to sum

Expression:

Sum({$<[Calendar day]={'>=$(=vLatestDay)'}> } [WH Stock])

Can you please let me know if the syntax for the expression is OK? It does not seem to give me the expected result

Thanks,

R

4 Replies
tamilarasu
Champion
Champion

Hi Riley,


Try,


Sum({$<[Calendar day]={">=$(=vLatestDay)"}> } [WH Stock])


or


Sum({$<[Calendar day]={">=$(vLatestDay)"}> } [WH Stock])


Make sure date format for the field Calendar day and variable vCurrentMonth should match.

Kushal_Chawda

Expression looks ok. what is the expression for vLatestDay?

Anonymous
Not applicable

Expression looks okay, just bypass the Date Field, make sure Format should be common throughout..

try this:

=Sum({$<DateField= ,[Calendar day]={'>=$(=vLatestDay)'}> } [WH Stock])

sebastianlettner
Partner - Creator
Partner - Creator

Hi,

first, you use a single quote, you should use a double qoute.

A Primer on Set Analysis

What is the value of vLatestDay, is it a value or a expression? Try to remove the equal sign.

The Magic of Variables

Is vLatestDay in the correct format?

Why don’t my dates work?

Get the Dates Right

Regards

Sebastian Lettner