Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
massimo6919
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 ?

19 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Ciao Massimo,

prova così:

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


se ancora non funziona prova ad inserire al posto della variabile una data nel tuo formato e verifica cosa accade.


Fammi sapere


Not applicable

vai massimo che ce la fai

massimo6919
Contributor
Contributor
Author

Non funziona ancora .. se metto la data fissa mi restituisce 0

Not applicable

dipende dalle impostazioni di date del tuo sistema operativo.

devi cercare di uniformarti a questo aspetto secondo me.

non riesci a allegare qualcosa?

massimo6919
Contributor
Contributor
Author

Allegato!

mangalsk
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

Not applicable

is too static: if he doesnt want to select 2014??

Not applicable

Create variables for both Year and Month

Year =Max(Year)

Month=Max(IF(Year=$(Year),MonthNum))

Like this you can make it dynamic

By default the variables will hold max year and maxyear's corresponding max monthnum

and if any selections made from those selections the va riables will change accordingly.

mangalsk
Creator III
Creator III

Hiee,

Its not static.

Select any year it will give corresponding value.

Try any year selection

Not applicable

I meaned that if u select that field (YEAR) then this can impact with other sheets and selections: the use of variables seems to be better in my opinion, so u can select the year having a value of the expression corresponding to what u prefer