Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
I am trying to see if next number is lower than the next...but I am having issues when it sees the first number or next
I have tried both expressions
if((Sales)< peek(sales),'1','0') as flag
if((Sales)< previous(sales),'1','0') as flag
basically
Month 1 , sales = 10 ...flag = 1
Month 2, sales = 9.8 ... flag = 1
Month 3, sales = 9.9 ....flag = 0
Month 4 Sales = 9.9 ... flag = 0
Month 5 Sales = 15 .... flag = 0
how can I make Month 1 flag be 0?
please help
are your months strings or numbers ?
if they are string, then try adding a number and apply the sort on a descending way, peek or previous should work as long as you use the same field name, like Jonathan already suggested
Is the field Sales or sales - QV field names are case sensitive.
The correct syntax would be:
If(Sales < Alt(previous(Sales), 0), 1, 0) as flag,
Hi
Please find the attachement of QVF of your requirement ..
Note : I am assuming 'Sales' as field name ...
hi
I have tried both and both give me same answer I have been getting
any other ideas please?
HI,
You need to make sure you data is orders by the month,
Then you Can do something like
IF(RowNo() = 1,
0,
IF(Sales < previous(Sales),
1,
0
)
) as flag,
If you have multiple years you can add a check for year in a similar fashion
Mark
are your months strings or numbers ?
if they are string, then try adding a number and apply the sort on a descending way, peek or previous should work as long as you use the same field name, like Jonathan already suggested
Hi guys
still a problem,
I am loading in from SQL tables
I have tried order by month too
I have even tried
Num(replace(Sales, ' ', '')) as Sales... to make sure it sees a number field
I am guessing its rounding the figure? because its decimal places?
please help
Hi
after some testing ..it only works, if field is cast as an int ...not numeric
thanks guys for your help x