Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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

Re: NEST NEED SEVERAL EXPRESSIONS

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

4 Replies

Re: NEST NEED SEVERAL EXPRESSIONS

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

Re: NEST NEED SEVERAL EXPRESSIONS

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)

Re: NEST NEED SEVERAL EXPRESSIONS

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

Re: NEST NEED SEVERAL EXPRESSIONS

You are amazing, thanks