Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable not variable.

Hi,

I made this little script to see how much money you could save.And it appears that this var $(situation) is not changing at all

at this line : let $(situation) = FieldValue('S1',$(a)) ;

let $(situation) = -200;

for a=1 to num($(count_month))

RVNUS:
LOAD *,
DATE_PAIE as ID_Date
;
LOAD
*,
$(situation) + MONTANT_REVENUS as S1,
monthstart(MonthStart($(date_depart)) + (($(a)-1)*31) ) as DATE_PAIE
RESIDENT REVENUS_TMP1;

let $(situation) = FieldValue('S1',$(a)) ;
TRACE Nlle situation = $(situation) ;
TRACE $(a) ;
NEXT

I've made this, just for fun and it's not fun anymore....

1 Reply
Not applicable
Author

Try declare your variable:

LET situation = -200.

When use value of variable, you set $(situation):

$(situation) + MONTANT_REVENUS as S1,

When get value:

situation = FieldValue('S1',$(a)) ;