Qlik Community

QlikView Performance

Discussion Board for collaboration on QlikView Performance.

amrita90
New Contributor

Please help me to have an If condtion statement converted to set analysis expression

Please convert the below statement into set anlaysis expression

if(SCV_LAST_INS_REPAIR_INDICATOR='Y' and (SCV_LATEST_INSURRANCE_DATE-SCV_LAST_INSURRANCE_DATE)<=90,'Pass'

Thanks

AS

3 Replies
felipedl
Valued Contributor III

Re: Please help me to have an If condtion statement converted to set analysis expression

HI ANita,

I believe you have a misguided understanding of set analysis.

Extracted from Qlik Help:

Set analysis and set expressions ‒ QlikView

"Normally, when you make a selection, aggregation functions, such as Sum, Max, Min, Avg, and Count aggregate over the selections that you have made: the current selections. Your selections automatically define the data set to aggregate over. With set analysis you can define a group that is independent of the current selections. This can be useful if you want to show a particular value, for example, the market share of a product across all regions, irrespective of the current selections."


So, if your not aggregating the data in some way (as examplified by the functions above) you should do what you need in the LOAD script rather than set analysis.


Something like


Data:

Load

     SCV_LAST_INS_REPAIR_INDICATOR,

     SCV_LATEST_INSURRANCE_DATE,

     SCV_LAST_INSURRANCE_DATE,    

     if

     (

          SCV_LAST_INS_REPAIR_INDICATOR='Y'

          and

          (SCV_LATEST_INSURRANCE_DATE-SCV_LAST_INSURRANCE_DATE)<=90,

          'Pass',

          'Don't Pass'

     ) as Description

From [Whatever]


Hope it helps.


Felipe.

vishalwaghole
Valued Contributor II

Re: Please help me to have an If condtion statement converted to set analysis expression

Its look like you want to assign flag as pass or fail based on some condition.

To achieve this you will not require any set analysis.

You can simply achieve it at script level.

Thanks,

Vishal

amrita90
New Contributor

Re: Please help me to have an If condtion statement converted to set analysis expression

@Felip : Thanks for simplifying the code , it did help out to lessen the access time , as we are looking into performance optimization.

Any other measures u suggest , might help out in perf.. optimization of the reports .

Thanks ,

AS@

Community Browser