Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There,
Am wondering if someone can assist with the below set analysis syntax?
sum(
{
<
SALE_DT >= AddMonths(MakeDate(Year(Now()), Month(Now()), '01'), -12)
,
SALE_DT <= MakeDate(Year(Now()), Month(Now()), '01')
>
}
SALES_AMT
)
I need to get the sum of sales between the sales date range of
01/JUNE/2008 and 01/JUL/2009
Unfortunately Qlikview 8.5 does not flag if Set analysis syntax is incorrect or have a query builder for set analysis.
Thanks,
Kevin.
Your syntax is a little off. First, you can't use >= or <= where you are. There, you need a Set Operator. Replace those with equal signs.
You're also missing the brackets around your Set Modifiers.
Then you need to do the greater than or equal and the date expression inside a dollar sign expansion. Dates seem to be the most difficult to get right when doing Set Analysis for me. I usually end up trying out a few different things before getting it right.
Try this:
sum({<SALE_DT = {'>= $(=AddMonths(MakeDate(Year(Now()), Month(Now()), '01'), -12))},
SALE_DT = {'<= $(MakeDate(Year(Now()), Month(Now()), '01'))}>} SALES_AMT)