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

Date variable and set analysis

I have a date variable associated to a calendar object. This variable should be used at the following set analysis expression (text object):

= money(sum({<[Data Receb/Pagto]= {$(#Data Base)}>} [Valor Original]))

It always returns 0 (zero), although having data to sum. The [Data Receb/Pagto] field, when used in a text object returns a "date". The "Data Base" variable, when used in a text object returns a "number". In this way, I thought that the set analysis expression should be changed, but it made no diference:

= money(sum({<[Data Receb/Pagto]= {$(=#date($(#Data Base)))}>} [Valor Original]))


or


= money(sum({<[Data Receb/Pagto]= {$(=#num($(#Data Base)))}>} [Valor Original]))



What is wrong?


regards,

Paulo Costa

1 Solution

Accepted Solutions
sunny_talwar

I just read that your variable returns a number. Give this a try:

=Money(Sum({<[Data Receb/Pagto] = {"$(=Date($(DataBase), 'yourDateFormat'))"}>} [Valor Original]))

Replace yourDateFormat with whatever format you have for [Data Receb/Pagto]

View solution in original post

6 Replies
sunny_talwar

#Date Base is the name of your variable?

Try this:

=Money(Sum({<[Data Receb/Pagto]= {"$(#Data Base)"}>} [Valor Original]))

Anonymous
Not applicable
Author

"Data Base" is the name of my variable.

The expression that you posted made no difference.

sunny_talwar


My suggestion is to have no spaces between your variable name (Something like this would be ideal vDataBase)


Try this:

=Money(Sum({<[Data Receb/Pagto]= {"$(Data Base)"}>} [Valor Original])) or

=Money(Sum({<[Data Receb/Pagto]= {"$('Data Base')"}>} [Valor Original])) (never worked with variables which have a space between them, so not sure how can they be used and that's why I suggest using vDataBase)

If you do use vDataBase then you can try this:

=Money(Sum({<[Data Receb/Pagto]= {"$(vDataBase)"}>} [Valor Original]))

Anonymous
Not applicable
Author

I´ve changed the variable name (elimitating blank - DataBase) and it remais the same. Zero as result.

sunny_talwar

I just read that your variable returns a number. Give this a try:

=Money(Sum({<[Data Receb/Pagto] = {"$(=Date($(DataBase), 'yourDateFormat'))"}>} [Valor Original]))

Replace yourDateFormat with whatever format you have for [Data Receb/Pagto]

Anonymous
Not applicable
Author

It´s running fine now. THANKS!

='Total, com base na data base = ' & money(sum({<[Data Receb/Pagto]= {"$(=date($(DataBase),'DD/MM/YYYY'))"}>} [Valor Original]))