Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi please find the Attachment.
You might not have any sales registered on date prior to your maximum date (max(date)-1) and that is why you are getting 0 for the first expression.
The second expression calculates sum of sales for the date prior to minimum date (min(date)-1). Such date should not exist.
Hi Renes,
If Possible please attach the qvw file with the sample data.
Regards,
Nilesh Gangurde
Hi,
Max() always return a numeric value, while my guess is that the field "date" has a non numeric value ("21/05/2012") so you will need to format it in the set analysis functions, for example:
Sum({< date = {'$(=Date(max([date])-1))'} >} sales)
Anyway, try in a text object that the result of the function is the same as the format in the "date" field. Note as well that in QlikView fields are case sensitive, so "Date" is not the same as "date".
Hope that helps.
Miguel
Hello Nilesh, hereby the qvw.
Thank you for your help.
Hello Nilesh, did you find the error?
Hi,
Did you try the solution I suggested below? That's working for me in your file.
Miguel
Hello Miguel,i've tried your answer
Sum({< date = {$(=Date(max([date])-1)) } >} sales)
but that didn't work for me. What i'm trying to do is select the sales from yesterday and i don't know what i'm doing wrong. I have to say that i am new with qlikview developer.
Hi,
Then I recommend you to check this file that uses variables to get maximum and minimum dates, and uses set analysis.
Hope that helps.
Miguel
Hello Miguel,you're example is much too difficult for me. I've just started yesteday with a selfstudy.
The only thing that i'm trying to do is: get the salesturnover from yesterday but i am not able to do so (even get today i cannot accomplish).
So the only thing i can produce in the definition is sum(sales). But how can i use a date within this formula?