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: 
Anonymous
Not applicable

Muliple records depending on field value

Hi

I have file that shows the number gifts given by each donor.

Here is a simple example:

DonorSummary:
Donor, GiftCount
'A',       1
'B',       2
'C',       3
'D',       0

and I would like to create a file showing who has given at least each number of gifts.

Donor A would have 1 record, because it's true that they have given at least 1 gift

Donor B would have 2 records, because it's true they have given at least 1 and true they have given at least 2.

Donor C would have 3 records.

Donor D would have no records.

The file would look like this:

Donor,      AtLeast

'A',       1

'B',       1

'B',       2

'C',       1

'C',       2

'C',       2

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Something like this:

LOAD

     Donor,

     IterNo() as AtLeast

FROM

     ...source...

WHILE

     IterNo <= GiftCount

     ;


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

Something like this:

LOAD

     Donor,

     IterNo() as AtLeast

FROM

     ...source...

WHILE

     IterNo <= GiftCount

     ;


talk is cheap, supply exceeds demand
marcus_sommer

You could loop this with a while-statement like:

load Donor, iterno() as AtLeast

From XYT while iterno() <= GiftCount;

- Marcus

marcus_sommer

You see what I mean - I was too slow again

Gysbert_Wassenaar

Ok, but there's nothing wrong with the quality of your answer


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thank you Gysbert and Marcus.

That works perfectly.

David