Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for
Did you mean:
Partner - Contributor III

## Two expressions with two dates in set analysis not working

Hi

I've got a pivot table with dimensions: Week and Weekday for a selected year. I have to show the sales for each week and week day for the selected year, and for the previous year.

I've got a calendar that gives me the fields week number and weekday and a fact table with the sales. In the calendar, for each date I also have the same date for the same week and weekday for the previous year.

I can get it work for the current year, but when I write the expression for the last year, I get 0 for all.

Expression for current year: sum(ImporteSinIVA)

Expression for last year: Sum({<Año, Mes, Trimestre, DiaSemana, Semana, Fecha, MismoDiaAA={'\$(vMismoDiaAA)'}>}ImporteSinIVA).

Here, variable vMismoDiaAA = Date(Max(MismoDiaAA), 'DD/MM/YYYY'). The field "MismoDiaAA" is in the calendar, and it's calculated for each day, as stated above.  The variable is defined with the sign "=" at the beginning.

I have attached the table should it help.

Any idea?

Labels (2)

• ### Set Analysis

4 Replies
Partner - Specialist III

Hi, does it work if you use an = in the variable in the set analysis (before the varibale name)..

MismoDiaAA={'\$(=vMismoDiaAA)'}>}ImporteSinIVA)

?

Employee
https://community.qlik.com/t5/Qlik-Design-Blog/Quotes-in-Set-Analysis/ba-p/1471824

Double quotes looks to be a good option here.
To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.
Partner - Contributor III
Author
Unfortunately it doesn't work. However
Sum({<Año, Mes, Trimestre, DiaSemana, Semana, MismoDiaAA={"=\$(vMismoDiaAA)"}>}ImporteSinIVA) will show the me same amount as the current date.

As you see, I have now changed the single quotes to double quotes, and added the = at the left of the "\$". But I'm not there yet
Partner - Contributor III
Author