Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If Statement in Resident Load

Hello, I have loaded resident tables many times, but never had the need to use an "IF" statement in one.

If I comment "//" the statement the table loads, so the error is there.

Here is the code to see if any one of you has an idea what I am doing wrong.

Thanks

RTP100_TOTALES:
Load
(
[ORDEN_FABR1]) as [ORDEN_FABR1],
IF ( [TOT_ENT_PT] = [TOTAL_CORT_SUMA], 'Z', ESTATUS_RTP1001) AS [ESTATUS_RTP1001],
(
[FABRICA_PRODS1]) as [FABRICA_PRODS1],
(
[FABRICA_SACO1]) as [FABRICA_SACO1],
(
[FABRICA_PANT1]) as [FABRICA_PANT1],
(
[FABRICA_CHAQ1]) as [FABRICA_CHAQ1],
([CLAVE_REF_COL_TALLA]) as [CLAVE_REF_COL_TALLA],
(
[TOT_UNID_1RA_SUMA_PT]) AS [TOT_UNID_1RA_SUMA_PT],
(
[TOT_UNID_2DA_SUMA_PT]) AS [TOT_UNID_2DA_SUMA_PT],
(
[TOT_ENT_PT]) as [TOT_ENT_PT],
(
[NUM_FECHA1_PT]) as [NUM_FECHA1_PT],
(
[FECHA1_PT]) as [FECHA1_PT],
(
[REFERENCIA]) as [REFERENCIA],
(
[COD_COLOR]) as [COD_COLOR],
(
[TALLA]) as [TALLA],
(
[PMAYOR]) as [PMAYOR],
(
[PVP]) as [PVP],
(
[TOTAL_UNID_EXTRAV]) as [TOTAL_UNID_EXTRAV],
(
[UNID_ENT_OTRAS]) as [UNID_ENT_OTRAS],
(
[UNID_ENT_OTRAS_2DA]) as [UNID_ENT_OTRAS_2DA],
(
[TOTAL_UNID_PRG]) as [TOTAL_UNID_PRG],
(
[TOTAL_CORT_SUMA]) as [TOTAL_CORT_SUMA]

Resident RTP100_completo;

drop table RTP100_completo;

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Yes, all the fields are in the Resident table. Also tried with and without the "[]" brackets.

I solved this by using "NoConcatenate" before the Load statement. Read it on another discussion and it worked.

Thanks for your help.

Yaira

View solution in original post

4 Replies
MayilVahanan

HI

Try like this

All the fields available the RTP100_completo? Check once.

Why using "as"?

You are using the same name , no need to use "as" here. When you need to rename it, you can use it..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try this.

   IF ( [TOT_ENT_PT] = [TOTAL_CORT_SUMA], 'Z', [ESTATUS_RTP1001]) AS [ESTATUS_RTP1001],

   Also make sure that  Table  RTP100_completo have these

   [TOT_ENT_PT] and  [TOTAL_CORT_SUMA] Field.

Regards,

Kaushik Solanki

      

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

Yes, all the fields are available.

Thanks for the TIP about "as". Since I am new to SQL and QlikView I take what works and type it right in again. But you are right.

I solved this by using "NoConcatenate" before the Load statement. Read it on another discussion and it worked.

Thanks for your help.

Yaira

Not applicable
Author

Hi,

Yes, all the fields are in the Resident table. Also tried with and without the "[]" brackets.

I solved this by using "NoConcatenate" before the Load statement. Read it on another discussion and it worked.

Thanks for your help.

Yaira