Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

if to set analysis

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))

4 Replies
Contributor III

Re: if to set analysis


pls put some sample.

Not applicable

Re: if to set analysis

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 ?

Valued Contributor III

Re: if to set analysis

To turn this expression in set analysis you need to add some flag fields with your if functions like this:



          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)



Not applicable

Re: if to set analysis

May be vFec varibale is generated by user selections ?

Community Browser