Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jyothish8807
Master II
Master II

Resolve circular loop

Hi All,

I have three Tables:

   

Coust_IDDateExpense
112-Feb-14100
211-Mar-15221
323-Mar-15245
41-Jun-15

334

 

REG_IDPeriodYearBudget
A1220151000
A212015500
A332015200
A422015300

 

REG_IDCoust_ID
A11
A22
A33
A44

And i want my output as like this:

 

JanFebMar
Expense
Budget

So when ever i try to map the dates it is forming a circular reference.Any suggestions will be really helpful. jagan

Regards

KC

Best Regards,
KC
1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Table1:

LOAD

MonthName(Date) AS YearMonth,

CustID,

Expense

FROM Table1;

LEFT JOIN (Table1)

LOAD

*

FROM Table3;

Table2:

Noconcatenate

LOAD

REG_ID,

MonthName(MakeDate(Year, Period) ) AS YearMonth,

Budget

FROM Table2;

LEFT JOIN(Table2)

LOAD

*

FROM Table3;

Concatenate(Table1)

LOAD

*

FROM Table2;

DROP TABLE Table2;

Hope this helps you.

Regards,

Jagan.


View solution in original post

9 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Table1:

LOAD

MonthName(Date) AS YearMonth,

CustID,

Expense

FROM Table1;

LEFT JOIN (Table1)

LOAD

*

FROM Table3;

Table2:

Noconcatenate

LOAD

REG_ID,

MonthName(MakeDate(Year, Period) ) AS YearMonth,

Budget

FROM Table2;

LEFT JOIN(Table2)

LOAD

*

FROM Table3;

Concatenate(Table1)

LOAD

*

FROM Table2;

DROP TABLE Table2;

Hope this helps you.

Regards,

Jagan.


PrashantSangle

Hi,

Just join your first last table.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jyothish8807
Master II
Master II
Author

Then it will create a synthetic key, when i map month from both table.

Regards

KC

Best Regards,
KC
PrashantSangle

Hi,

Try below code

Table1:

Select Coust_ID,

Date,

Expenses

from table1;

join

select RegID,

Coust_ID

from table3;

Table2:

select Reg_ID,

Period,

Year,

Budget

from Table2;

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

For that create key which gives you unique data.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
amit_saini
Master III
Master III

KC,

Like this???

Thanks,

AS

jyothish8807
Master II
Master II
Author

Hi Jagan,

Its creating multiple dates like this:

 

Jan 2015
Jan 2015
Jan 2015
Jan 2015
Jan 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Feb 2015
Mar 2015
Mar 2015
Mar 2015

Mar 2015

Regards

KC

Best Regards,
KC
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this

Hi,

Try like this

Table1:

LOAD

MonthName(MonthEnd(Date)) AS YearMonth,

CustID,

Expense

FROM Table1;

LEFT JOIN (Table1)

LOAD

*

FROM Table3;

Table2:

Noconcatenate

LOAD

REG_ID,

MonthName(MakeDate(Year, Period) ) AS YearMonth,

Budget

FROM Table2;

LEFT JOIN(Table2)

LOAD

*

FROM Table3;

Concatenate(Table1)

LOAD

*

FROM Table2;

DROP TABLE Table2;

Hope this helps you.

Regards,

Jagan.

jyothish8807
Master II
Master II
Author

Thanks a lot jagan, i fixed it.

Regards

KC

Best Regards,
KC