Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
what is wrong with the expression(aggr is wrong):
sum({<inpdate={'<=$(=date($(saldate)))
>=aggr(min({<inpdate={'<=$(=date($(enddate)))>=$(=date($(startdate)))'}>}inpdate),SERIALNO)
'}>} SALES)
the third get the min date by serialno
It get the wrong result the same.
Jack he - If you got solution please mark as correct answer, or any issues please let us know I'll work tomorrow. Otherwise somebody can help you.
Bye good night.
It seems it don't work with min , thanks.
Hey,
Please ret to make selections in Impdate field beside start and enddate
variables. Maybe then it will be possible to resolve min(impdate) inside
set expression.
02-04-2014 16:58 użytkownik "Alejandra Carrasco" <qcwebmaster@qlik.com>
napisał:
Qlik Community <http://community.qlik.com/> HOW TO WRITE it
reply from Alejandra Carrasco<http://community.qlik.com/people/MAle_Carrasco?et=watches.email.thread>in
Scripting - View the full discussion<http://community.qlik.com/message/500856?et=watches.email.thread#500856>
=min({<INPDATE={'>=$(=date($(vStart)))<=$(=date($(vEnd)))'}>}INPDATE)--- this can get the right answer .but It can't put in the expression.
But then try to use min(impdate) without $
02-04-2014 17:06 użytkownik "jack he" <qcwebmaster@qlik.com> napisał:
Qlik Community <http://community.qlik.com/> Re: Re: HOW TO WRITE
it
reply from jack he<http://community.qlik.com/people/Jacke_he?et=watches.email.thread>in
Scripting - View the full discussion<http://community.qlik.com/message/500897?et=watches.email.thread#500897>
If it will not work, i suggest you to consider rearanging data model. If
you want, please write a little about your business case and we will try to
find some solution...
Regards
Darek
02-04-2014 17:35 użytkownik "darikmi ." <dariusz.mielczarek@gmail.com>
napisał:
But then try to use min(impdate) without $
02-04-2014 17:06 użytkownik "jack he" <qcwebmaster@qlik.com> napisał:
>> Qlik Community <http://community.qlik.com/> Re: Re: HOW TO WRITE
>> it
>>
>> reply from jack he<http://community.qlik.com/people/Jacke_he?et=watches.email.thread>in
>> Scripting - View the full discussion<http://community.qlik.com/message/500897?et=watches.email.thread#500897>
>>
Hello again,
After additional thoughts I wanted to propose to consider the return of one step back and consider whether the data model could better support the calculation results. It seems to me that in the current ukłdzie we have a problem with getting the expected results and perhaps not even possible. Finally, the data model is the foundation of solution and its incorrect definition may result in problems with the calculation.
If you're considering such a scenario, please describe briefly your application business assumptions. I'll try to suggest an alternative approach.
Of course, if anyone has reached the correct result on the current model, I would be very interested in reading the solution
regards
Darek
Try this. It has results you expected when startdate is 10.01, and also has 14 for B when startdate is 18.01
I prepared 2 expressions. First works with variables (start, end). 2-nd expression doesn't use those variables. It is only sensitive for selection in INPDATE field.
I'am also thinking why you need enddate? What if for some start and end date there is no INPDATE for some SERNO?
I dont know why, but first expression will not exclude tghose cases. I think there may be something with date format ....
But 2-nd approach excludes it ....
Have fun with QV
regards
Darek
The first seem ok. this is because I want to get the sum of sales between dates of buy.