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

Set Analysis 1 Field = Another

I am trying to convert a functioning If/Then to set analysis.   The problem is in trying to only use values in the sum where the dates are equal.  Any ideas? 

This expression works perfectly:

=sum(if(Received='1' and ReceivedDate = DailyRateDate and DailyRateType='Daily', Sales/DailyRate))

This expression does not work:

=sum({<Received={1}, ReceivedDate={"=ReceivedDate=DailyRateDate"},DailyRateType={Daily},>} Sales/DailyRate)

Thanks very much,

Richard

UPDATE -------

Maybe Sample Data below will help.  This is essentially what I need to do:

SALESTABLE                                   RATETABLE

Sales     Rate     ReceivedDate          Rate          RateDate     DailyRate

10          1          3/1/2013                     1               3/1/2013       .5

20          1          3/5/2013                     1               3/5/2013      .55

20          2          3/1/2013                     2               3/1/2013       .6

3 Replies
manideep78
Partner - Specialist
Partner - Specialist

=sum({<Received={1}, ReceivedDate={"DailyRateDate"},DailyRateType={Daily},>} Sales/DailyRate)

Not applicable
Author

Tried with similar expressions, it works fine for me.

Is it typo error, an extra comma symbol at the end of set modifier..

=sum({<Received={1}, ReceivedDate={"=ReceivedDate=DailyRateDate"},DailyRateType={Daily}>} Sales/DailyRate)

Not applicable
Author

The comma was a typo in the post.   I tried that one and it did not work for me.    Not sure what to try next.  i thought about using the working if/then in the script.  Maybe your script suggestion would work too, wil have to think about how to implement that one.