Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
MauStrQua
Contributor II
Contributor II

Correct price at the corresponding date

Hello together

The following problem as an example:
We sell apples for 1.50€. From 01.03.2022 - 30.04.2022 the purchase price was 1€. From 01.05.2022 - Now the purchase price is 1.15€.

I have now sold 100 apples. 40pcs before 01.05.2022 60pcs after. Each apple has its own sales date stored.

I maintain the purchase prices in a separate table with 3 columns (date valid from - date to + price).

Now he should automatically take the right price.
I have already looked at the "IntervalMatch" function, but do not quite understand this if it should be the right one

Greetings

Labels (1)
1 Reply
SchalkF
Contributor III
Contributor III

Hi,

You could try using an if statement to achieve this, something like this:

if(([AppleSellDate] > [date valid from]) and ([AppleSellDate] < [date valid to]), Price) as ApplePrice

Kind regards