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: 
inescastelhano
Partner - Creator II
Partner - Creator II

Qlikview is ignoring selections

Hello all,

I am facing this problem:

I have the following table and the calendar on the left (myDay, myMonth, myYear). I would like to calculate the value spent per year (per customer). I only want the payment years which are equal to the selected year. In this case, only 2016 should appear, but all the payment years are appearing.

This is my table expression (value per year):

=sum({<myYear=, myMonth=, myDay=, myDate=,CustomerID={'*'}-{'-1'}, [Payment Year] = {'>=$(=date(min(myYear)))<=$(=date(max(myYear)))'}>}[Sum Per Year])

qlik1.PNG

Any ideas on how to do this? Thanks in advance.

Cheers,

Inês

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=Sum({<myYear=, myMonth=, myDay=, myDate=,CustomerID={'*'}-{'-1'}, [Payment Year] = p(myYear)>}[Sum Per Year])

View solution in original post

9 Replies
ali_hijazi
Partner - Master II
Partner - Master II

you need to use the year part of the date so why are you using Date(max(MyYear)))

what is My_Year? is it a date value or year as integer?

I can walk on water when it freezes
sunny_talwar

May be this:

=Sum({<myYear=, myMonth=, myDay=, myDate=,CustomerID={'*'}-{'-1'}, [Payment Year] = p(myYear)>}[Sum Per Year])

inescastelhano
Partner - Creator II
Partner - Creator II
Author

Unfortunately it doesn't work .

inescastelhano
Partner - Creator II
Partner - Creator II
Author

Hi,

I want to show only "Payment Year" that equals MyYear(selected year). Both of them are date fields.

sunny_talwar

Do you have a sample you can share?

Colin-Albert

Are myDate, myDay, myMonth and myYear associated with the transaction dates in your data?

Posting a view of your data model may help.

ali_hijazi
Partner - Master II
Partner - Master II

so you need to get the year of those dates

so use Year(Date(max(myYear)))

cause I assume that Payment Year is a year value not a date no?

I can walk on water when it freezes
awhitfield
Partner - Champion
Partner - Champion

Hi Ines,

it would be best if you could upload an example qvw, then we can see what's happening.

HTH

Andy

inescastelhano
Partner - Creator II
Partner - Creator II
Author

Hi all,

Unfortunately it was my fault, I had somehow defined an alternate state and it wasn't working because of that. Now it's done.

Thank you!