Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor

Date variable in a expression

I have this expression with a costant limit :

SUM(if(data<= '15/01/2014' ,SALDO,0))

if i want to insert a date store in a variable genn_data i wrote

sum(  {$<data<=$(genn_data)>} SALDO)

but don't return the same value. What is wrong ?

1 Solution

Accepted Solutions
Creator III
Creator III

Hello,

Kindly find the attachment where

I have changed variable

genn_data=='15/01/'&ANNO

and expression to SUM(if(data<= genn_data ,SALDO,0))

Now its giving correct value if year 2014 selected.

Regards,

Mangal

View solution in original post

19 Replies
Champion
Champion


sum(${<data={"<=$(=Date(genn_data,'DD/MM/YYYY'))"}>}SALDO)

MVP
MVP

SUM({$<data = {'<=$(genn_data)'}>}SALDO)

sum(  {$<data={'<=$(genn_data)'}>} SALDO)


but you must pay attention to data format

Hi,

Try this,

sum({$<data={"<=$(genn_data)"}>} SALDO)

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Specialist II
Specialist II

What do you get back?

You are probably missing some quotes around your expression i.e. "<=$(genn_data)"

Contributor
Contributor

when i use costant value the return is     -120953,3

with the alternative give me i obtain         -134040,26

Hi,

Then First Convert into date Format like,

sum({$<data={"<=$(=Date(genn_data,'DD-MM-YYYY'))"}>} SALDO)


Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Not applicable

Hi,

try like this

Sum(data={"<=$(genn_data)"}>} SALDO)

Note: Your variable giving DD/MM/YYYY format and your field data should also be in the same format

Not applicable

Massimo,

When doing such date comparisons, I would recommend you to store an integer into your variable with the num function:  num(theDateYouWant) or date#()

The comparison will be easier (no date format to write) and certainly safer.

Fabrice