Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
This one is kind of weird and I think the answer lies in knowledge of set analysis, which I do not have.
I have 2 dates and counts for each of those dates (I've named them max and min, but they are max(date) and max(date,2)). I set the counts for each of these into a variable;
vmaxDate : =count({1<Date1 = {"$(=Max(Date1))"}>} stuff)
vminDate : =count({1<Date1 = {"$(=Max(Date1,2))"}>} stuff)
In my qlikview I have a text box with a convoluted expression:
=if(vmaxDate>vminDate, num(((vmaxDate-vminDate)/vmaxDate)*100, '#.##') & '%', num(((vminDate-vmaxDate)/vminDate)*-100, '#.##') & '%')
What I would like is when a date is selected (I have a listbox up) the expression in the textbox and subsequently the variables only still looks at the 2 maximum dates. In terms of the expression above, if I select any date, the function returns 100.00% and I want it to stay at the -60.00% it is currently.
note: I know there are alternative methods, such a detached chart etc. But I'm more interested in the context of these expressions and whether it's possible to write it up.
Thanks!
Change your variables to this
vmaxDate : =count({1<Date1 = {"$(=Max({1}Date1))"}>} stuff)
vminDate : =count({1<Date1 = {"$(=Max({1}Date1,2))"}>} stuff)
Change your variables to this
vmaxDate : =count({1<Date1 = {"$(=Max({1}Date1))"}>} stuff)
vminDate : =count({1<Date1 = {"$(=Max({1}Date1,2))"}>} stuff)