Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a variable storing Date in Set Analysis

Hi!

I´m having a problem....

I´ve got several Date fields in my Data and I need to be able to select one of those dates based in a variable that is storing another date.

Date fields:

     -Data;

     -dataVenda.

Variable:

     -vSetData =dataVenda

This variable captures date from "dataVenda". Used in a Text Box it returns the Date just fine. Text box, i´m using =vSetData

Now my problem is that I cannot use vSetData in Set Analysis... I´ve tried several expressions, and none of them worked.

My expression is plain simple, just a sum with set analysis:

Sum({$<Data={???????}>} Afield)

If I use, for instance,  Sum({$<Data={'26-09-2012'}>} Afield) it works fine.

I´ve used $(vSetData), =vSetData, some expressions with '=$(=vSetData)', I don´t know how many expressions have I tried... 😕

I need to use Data, because is the one directly related to the field I need to Sum.... I cannot use dataVenda directly in here...

Best Regards,

Bruno Silva.

18 Replies
Not applicable
Author

It´s a Date also... DD-MM-YYYY. And that worked fine in the solution you provide before... So I thought it was just switch the variable name and it would be working...

I don´t understand why it does return correct date in text box as in previous problem, and it does not work using same syntax, but with different variable.

MK_QSL
MVP
MVP

vSetDataLY = Date(AddYears(Max(dataVenda),-1),'DD-MM-YYYY')


Sum({$<Data={'$(=vSetDataLY )'}>}Afield)

Not applicable
Author

Again... No results.... Sorry...

It doesn´t work like this:

Data={'$(=vSetDataLY )'}

Neither like this:

Data={'$(vSetDataLY )'}

And again the Text Box return correct date!

MK_QSL
MVP
MVP

I need to stop guessing. Could you please upload your sample apps or sample data?

Not applicable
Author

LOL... You´re right! I will try to do that... as soon as I can.... Just got another issue from another client in hands that I need to solve.

Thank you!

Not applicable
Author

Hello again...

Here is the sample of the qvw in which I´m trying to implement the expression we´ve been talking about.

Thank you very much for your help!!!

Best Regards,

BS.

teste.qvw

EDIT - Forgot to tell you that you can test with date 26-Sep-2013 / 26-Sep-2012... In this one I´m sure that is data to show.

MK_QSL
MVP
MVP

Do one thing.. .Select any Date from Date Selector...

Now if you dont get any data for previous year....

Try to find out that you indeed have data for that particular date (previous Year)

If you select 28-12-2013 there should be some data for 28-12-2012

Not applicable
Author

Hi Manish.

In my example above, it doesn´t return any data to previous year, although I´m absolutly sure that data exists for that day... For instance, the date you suggested has data in both year dates.... but it doesn´t show it in previous year... The Qvw example wasn´t helpful to get to any conclusion?

Thanks,

BS.

Not applicable
Author

Just Solve it!

As I said before, I knew that it must be a minor detail... Don´t know why, but it only works with a 1 instead of $:

sum({1<Data={'$(vSetDataLY)'}>} Afield)

Thank you Manish for all your help and patience...

Best Regards,

Bruno Silva.