Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i need some help whit this IF.
I nedd change it to set analysis
'=Sum(IF((SEG='A' and DATE_REN<AddMonths(vFec-1, -1)),1,IF(SEG='ADMINISTRACIONES',0,IF(DATE_REN < vFec-1,1,0)))*IF(SALES>0,SALES,0))
Hi
pls put some sample.
I believe its not possible to completely turned the expression into Set Analysis. But if you can add the new field on Sales with some filters in the script level, may we can write set analysis on UI.
Can you please post sample qvw ?
To turn this expression in set analysis you need to add some flag fields with your if functions like this:
Flags_ETL:
LOAD
IF(SALES>0,SALES,0)) as PositiveSales,
IF(SEG='A', 1, 0) as FlagSeg,
IF(DATE_REN<AddMonths(vFec-1, -1), 1, IF(DATE_REN < vFec-1, 1, 0)) as FlagDate,
Resident YourMainTable;
Then you can use a expression like this:
=sum({$<FlagSeg = {1}, FlagDate = {1}>} PositiveSales)
Regards,
MB
May be vFec varibale is generated by user selections ?