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

loop through the current table to generate a new column

I have a table in the below structure and I want to generate one more column from the below that satisfying the below condition

 

The name of the column is called Dividend_paid since 01/01/2016.

 

The rule is to search For the same ASX code and add up last column(Dividend_Paid) if the date is between 01/01/2016 and the corresponding value in Date column. I think something loop will do the job, but not exactly how. thanks

Captureff.PNG

 

1 Solution

Accepted Solutions
Anil_Babu_Samineni

I wonder, why loop helps here. Some where try this?

If([ASX code] = Previous([ASX code]) and (Date >= MakeDate(2016,01,01) and Date <= Previous(Date)),'Flag1', 'Flag2') as Dividend_Paid

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

2 Replies
Anil_Babu_Samineni

I wonder, why loop helps here. Some where try this?

If([ASX code] = Previous([ASX code]) and (Date >= MakeDate(2016,01,01) and Date <= Previous(Date)),'Flag1', 'Flag2') as Dividend_Paid

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
woshua5550
Creator III
Creator III

try this

Load *,

         IF([ASX Code] = Previous([ASX Code]) And Date >= MakeDate(2016,1,1) And Date <= Previous(Date),Dividend_Paid + Previous(Dividend_Paid) As Dividend_Paid

From <TableName>

Order by [ASX Code]