Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ALL,
I want to write one conditional expression in QV for my chart.
In the expression i want to write something like
if(month(DateId)< Current month, actual abos,plannedabos)
Could anyone please send me the correct syntax for the same, i need this urgent.
Thanks,
Mahasweta
Hi,
Try this formula:
sum(if(monthstart(DateID)<=monthstart(today()) , abos, plannedabos ))
If you use function month(it will return a numbaer of the month but it will olso inlcude the months of last year. So if dateID is let's say 8/15/08 the formula will return abos in case you use month() and plannedabos in case you use monthstart(). Of course you have to take care:
1. DateID is not a key field because in QlikView these fields should not be used in formula (resuls are random). Create another Date field in case DateID is a key field.
2. Take care to have DateID, Date or whatever field you will use, formated as number or as date. If it's formated as text or string you will get an error or a wrong result.
That's it. Hope will help you.
Regards,
John