Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I have this expresssion for summing sales in a given period. Im trying to build an expression summing sales in the same From/To date period last year, but it doesnt seem to work out.
This year:
Sum( if( Date >= vKampFromDate AND Date <= vKampToDate, Sales))
Last year:
??
Thanks in advance
Hi @Selgum
try like this
Sum( if( Date >= AddYears(vKampFromDate,-1) AND Date <= Addyears(vKampToDate,-1), Sales))
Try with set analysis which is faster.
Sum({<Date ={">= $(=Date(AddYears(vKampFromDate,-1),'YourDateFormat')) <= $(=Date(Addyears(vKampToDate,-1),'YourDateFormat'))"}>} Sales))
Thanks for your quick reply. But either or, seem to do the trick
@Selgum Likely going to need to attach a sample QVW in this case, so folks can see the data model etc. in order to be sure to get you the correct solution on this one. If you can attach that, use the @symbol to flag Mayil, as that will ensure he gets notification you posted things. Sorry I do not have anything better to offer. You can check around the Design Blog area to see if you can find something there:
https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog
Regards,
Brett