Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can i write this if statement in the set analysis present in the below expression.
expression:
if(sum(total<GENDERFLAG,Color> itno28)=0,0,sum({<flag28={1}>}total <Style,Color,GENDERFLAG,Size> PDFC20*factor20*Avg12MonthsSalesPrice))
In the above expression sum( total<GENDERFLAG,Color> itno28 is my condition to check in if statement but is there any way i can use this is set analysis. The issue i am getting is please see attached screen shots.
Have a look at the attached.
sum(aggr(if(sum(total<Color>itno28)=0,0,sum({<flag28={1}>} total <Color,GENDERFLAG,Style> PDFC20*factor20*Avg12MonthsSalesPrice)),Color))
Maybe:
sum({<flag28={1},itno28={'sum(total<GENDERFLAG,Color> itno28)=0'}>}total <Style,Color,GENDERFLAG,Size> PDFC20*factor20*Avg12MonthsSalesPrice)
If that doesn't work, maybe try replacing the underlined itno28 with another one of your fields...
Also, are you sure you don't need the flag28={1} inside of the sum() in the set analysis?
Hi Nicole, Thanks for you fast reply. I tried your expression but i am getting all zeros. Below is the expression i have used.
sum({<flag28={1},itno28={'sum(total<GENDERFLAG,Color> itno28)=0'}>}total <Style,Color,GENDERFLAG,Size> PDFC20*factor20*Avg12MonthsSalesPrice)
Also i flag28=1 that flag is required in the set analysis. Please let me know if you need any additional information. Thanks for all your help.
Did you try replacing the underlined itno28 with another one of your fields? Try it with a few of them and see if it makes a difference.
sum({<flag28={1},itno28={'sum(total<GENDERFLAG,Color> itno28)=0'}>}total <Style,Color,GENDERFLAG,Size> PDFC20*factor20*Avg12MonthsSalesPrice)
If that doesn't work, you'll need to post a .qvw: Preparing examples for Upload - Reduction and Data Scrambling
Hi Nicole, attached is the qlikview document please let me know if you need further information.
Have a look at the attached.
sum(aggr(if(sum(total<Color>itno28)=0,0,sum({<flag28={1}>} total <Color,GENDERFLAG,Style> PDFC20*factor20*Avg12MonthsSalesPrice)),Color))
Thank you for your help let me apply this expression and get back to you .
Hi Nicole, you made my day... thanks a lot man..............................................
You're welcome. I'm glad it works