Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Partner - Specialist III
Partner - Specialist III

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
Specialist II
Specialist II

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

Anonymous
Not applicable
Author

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