Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

NEST NEED SEVERAL EXPRESSIONS

Hello,

Perform a table, listing various genres, each has different conditions to show included, what I try to do is use the IF, but when I try to enter the second I make mistake, someone knows how to solve this, accompanying the expressions. As I close the condition? Deputy table


if(GENERO='Televisa',

SUM({<CANAL={'TNCENA','TNCE2H','TNCNA5','TNCE1H'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'1M','2T','3P'}>}

IMPORTE_NETO)/1000)

,

if(GENERO='Deportivos',

SUM({<CANAL={'TNTDMX','TNTDUN'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'2T'}>}IMPORTE_NETO)/1000)

1 Solution

Accepted Solutions
sunny_talwar

May be you need to add the second closing parenthesis at the end and remove it at the end of first if statement:

If(GENERO='Televisa',

SUM({<CANAL={'TNCENA','TNCE2H','TNCNA5','TNCE1H'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'1M','2T','3P'}>}

IMPORTE_NETO)/1000-> Remove this one

,

If(GENERO='Deportivos',

SUM({<CANAL={'TNTDMX','TNTDUN'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'2T'}>}IMPORTE_NETO)/1000))

So like this,

If(GENERO='Televisa',

SUM({<CANAL={'TNCENA','TNCE2H','TNCNA5','TNCE1H'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'1M','2T','3P'}>}

IMPORTE_NETO)/1000

,

If(GENERO='Deportivos',

SUM({<CANAL={'TNTDMX','TNTDUN'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'2T'}>}IMPORTE_NETO)/1000))

View solution in original post

4 Replies
sunny_talwar

May be you need to add the second closing parenthesis at the end and remove it at the end of first if statement:

If(GENERO='Televisa',

SUM({<CANAL={'TNCENA','TNCE2H','TNCNA5','TNCE1H'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'1M','2T','3P'}>}

IMPORTE_NETO)/1000-> Remove this one

,

If(GENERO='Deportivos',

SUM({<CANAL={'TNTDMX','TNTDUN'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'2T'}>}IMPORTE_NETO)/1000))

So like this,

If(GENERO='Televisa',

SUM({<CANAL={'TNCENA','TNCE2H','TNCNA5','TNCE1H'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'1M','2T','3P'}>}

IMPORTE_NETO)/1000

,

If(GENERO='Deportivos',

SUM({<CANAL={'TNTDMX','TNTDUN'},

PRODUCTO=-{'integración'},

CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},

FRANJA={'2T'}>}IMPORTE_NETO)/1000))

Not applicable
Author

Ey Sunny

Thank you very much, I quite work out, so clean error, apply and remain, in theory perform the same operation as I have to add more expressions, and now I back out the error, I am doing wrong?

This is the expression that I have to do

if(GENERO='Televisa',SUM({<CANAL={'TNCENA','TNCE2H','TNCNA5','TNCE1H'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'1M','2T','3P'}>}IMPORTE_NETO)/1000,


if(GENERO='Deportivos',SUM({<CANAL={'TNTDMX','TNTDUN'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'2T'}>}IMPORTE_NETO)/1000))

,

if(GENERO='Novelas',SUM({<CANAL={'TNTLLA'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'3P'}>}IMPORTE_NETO)/1000)

,

if(GENERO='Peliculas'(SUM({<CANAL={'TNGOLD','TNGLED'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'3P'}>}IMPORTE_NETO)/1000)

,

if(GENERO='Música y Audio',SUM({<CANAL={'TNBAND','TNHITN'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'3P'}>}IMPORTE_NETO)/1000)

sunny_talwar

Try this:

If(GENERO='Televisa',SUM({<CANAL={'TNCENA','TNCE2H','TNCNA5','TNCE1H'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'1M','2T','3P'}>}IMPORTE_NETO)/1000

,

If(GENERO='Deportivos',SUM({<CANAL={'TNTDMX','TNTDUN'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'2T'}>}IMPORTE_NETO)/1000

,

If(GENERO='Novelas',SUM({<CANAL={'TNTLLA'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'3P'}>}IMPORTE_NETO)/1000

,

If(GENERO='Peliculas'(SUM({<CANAL={'TNGOLD','TNGLED'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'3P'}>}IMPORTE_NETO)/1000

,

If(GENERO='Música y Audio',SUM({<CANAL={'TNBAND','TNHITN'},PRODUCTO=-{'integración'},CLIENTE=-{'NACES','DERAS','VYPFE','CRECE','MARENO','MUFAR','IMEXLA'},FRANJA={'3P'}>}IMPORTE_NETO)/1000)))))

Instead of ending each of the if statement, end it at the end.

Not applicable
Author

You are amazing, thanks