Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Restricting data based on greater than or equal to date

Hi,

I have this code and I don't know why it doesn't work. It seems very simple but it just doesn't work. I want to sum the data if its greater than or equal to a date

sum({<ddis={'>=$(vMinDate)'}>}counter)

ddis is a date and vMinDate is a user selected date

I have tried with just = to the date and this works - sum({<ddis={'=$(vMinDate)'}>}counter)

Any ideas why when I use the >= it doesn't work?

Many thanks,
Emer

7 Replies
henrybrinkmann
Partner - Contributor II
Partner - Contributor II

Hi Emer,

try doublequotes

sum({<ddis={">=$(vMinDate)"}>}counter)


BR

Henry

rubenmarin

Hi Emer, you can create a straight table and create that expression, don't set a caption for that column, in the chart, leave your mouse on the caption (title) of the column to see how QV translates your variable.

Check if vMinDate returns the expected value and it has the same format as ddis. Maybe you only need to enclose one or both values (ddis and vMinDate) in a Date() function.

Or maybe you only need to add an equal sign at the start of the variable expression.

Anonymous
Not applicable
Author

Hi Emer,

Here's a great tool for getting the Set Analysis syntax right:

http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx?sa=

sgrice
Partner - Creator II
Partner - Creator II

Dates can be unpredictable in qlikview

your statement could have many issues

sum({<ddis={'>=$(vMinDate)'}>}counter)

if vMinDate is not a number but a text string of the date you may need to num it.

if vMinDate is a function like today() then you need to force it to number I.e. $(#=vMinDate)

if ddis is not a real QLikview date but just a string you will need to Date#(ddis,'YYYYMMDD') as ddis in the load script. [replacing YYYYMMDD with the map of the string to date]

I would always use " instead of ' when doing advanced search in set analysis too.

sum({<ddis={">=$(vMinDate)"}>}counter)

Anonymous
Not applicable
Author

Thanks for your reply, I tried both suggestions and its still not calculating it. When I leave my mouse on the caption it translates vMinDate as a number so ddis mustn't be a number so I will play around a little more to get it right.  vMinDate is just selected from a calendar of ddis

Anonymous
Not applicable
Author

Many thanks, I think it is something about how qlikview is handling the dates, I will make sure that both are in the same format

Anonymous
Not applicable
Author

Thanks this is a great tool!