Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How to resolve this loop?

Hi all,

I am facing this issue and could not resolve. Appreciate if someone can guide me along.

Basically, I have tried to create key between various tables hoping that it could synchronize the data but it failed.

If I add in the 2 fields (Attribute 1 and 2), then it fails. Otherwise, it works.

Really need to know the walk around for this, thanks.

Below is the scenario:-

ActualSalesTable:

LOAD

     Store,

     Item,

     ActualSales,

     Date,

SQL SELECT *

FROM $(DB)$(Comp1)$ActualSalesTable";

ItemTable:

LOAD

     Item,

     Attribute1,

     Attribute2,

SQL SELECT *

FROM $(DB)$(Comp1)$ItemTable";

FiscalYearTable:

LOAD

     Date,

     Day,

     Week,

     Month,

     Year,

     YearWeek

FROM Excel;

BudgetSalesTable: (OK)

LOAD

     Year,

     Week,

     BudgetSales,

     YearWeek

FROM Excel;

BudgetSalesTable: (NOT OK AFTER ADDING IN Attribute 1 and 2 -> Failed to synchronize due to loops)

LOAD

     Year,

     Week,

     Attribute1,

     Attribute2,

     BudgetSales,

     YearWeek,

FROM Excel;

8 Replies
jebamalai
Valued Contributor

Re: How to resolve this loop?

Try this

LOAD

     Year,

     Week,

     Attribute1 as Att1,

     Attribute2 as Att,

  BudgetSales,

     YearWeek,

FROM Excel;

Not applicable

Re: How to resolve this loop?

Hi Jebamalai,

Thanks for the reply. I have tried but it reloads properly without any loop issue but not what I want.

This is because the Attribute1 and Attribute2 are part of the important fields in the item master table.

I only change at the BudgetSalesTable but not ItemTable though.

jebamalai
Valued Contributor

Re: How to resolve this loop?

Then can you try to Quality the fields

senpradip007
Valued Contributor III

Re: How to resolve this loop?

Try this:

ActualSalesTable:

LOAD

     'Actual' As Source,

     Store,

     Item,

     ActualSales,

     Date,

SQL SELECT *

FROM $(DB)$(Comp1)$ActualSalesTable";

BudgetSalesTable:

LOAD

     'Budget' As Source,

     Year,

     Week,

     Attribute1,

     Attribute2,

     BudgetSales,

     YearWeek,

FROM Excel;

gines_rueda
New Contributor III

Re: How to resolve this loop?

I think the main issue is a cyclic relation against FiscalYearTable.

You could try to change

ActualSalesTable

Date to ActualSalesDate


and then create a different calendar.


Cheers.

Not applicable

Re: How to resolve this loop?

Hi all, thanks for the replies.

Jebamalai,

What do you mean by Quantity the field? Do you mean single code or something?

Pradip Sen,

I have tried using your method but what field should I be taking from the 2 tables to link up as source?

Gines Rueda,

Yes, I believe so but it is not a 1 table to 1 table, I think here they are 3 tables involved so even if I change the date to ActualSalesDate, I need to lookup from another table for the Attributes on Item Master.

I have seen people using the below command. Will that help and how should I be coding it?

left join <>

resident <>

DROP <>

jebamalai
Valued Contributor

Re: How to resolve this loop?

Sorry.It was Qualify

Qualify 'Att*'

senpradip007
Valued Contributor III

Re: How to resolve this loop?

ActualSalesTable:

LOAD

     'Actual' As Source,

     Store,

     Item,

     ActualSales,

     Date,

SQL SELECT *

FROM $(DB)$(Comp1)$ActualSalesTable";

Concatenate(ActualSalesTable)

LOAD

     'Budget' As Source,

     MakeWeekDate(Year,Week,1) As Date,

     Attribute1 AS Item,

     BudgetSales

FROM Excel;

Create a Master Calendar.

Community Browser