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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Min 3 dates values

hi All,

I wanted to take data whose expire date is greater than today().

I use from following code

One:
LOAD [Campaign Id],
[Batch Id],
[Start Date],
[Exp Date]
FROM

(
ooxml, embedded labels, table is Sheet1) Where [Exp Date]>Today();

but now I want to show data of  3 expire date of today in pivot or metric. Could anyone explain me how to do it?

do we have any good process than what I did here?

Thanks in adv.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be like this

Dimension

Batch Id

Campaign Id

Exp Date

Expression

Date(Only({<[Start Date] = {"$(='<=' & Date(Min([Start Date], 3), 'DD/MM/YYYY'))"}>} [Start Date]))

Updated the expression and attached a sample

View solution in original post

8 Replies
Anil_Babu_Samineni
MVP
MVP

You can use those Dates as Static in pivot expression

Sum({<[Exp Date = {'Date1','Date2','Date3'}]>}Sales)

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
sunny_talwar
MVP
MVP

now I want to show data of  3 expire date of today in pivot or metric.

3 expire date of today? What do you mean? Do you mean the campaign id which is within 3 days from today?

adamdavi3s
Master
Master

Do you mean this?


count({<[Exp Date] = {"<=$(=date(today()-3))"}>}Campaign Id)

sunny_talwar
MVP
MVP

Adam I think there is a typo in your and Anil's expression

Sum({<[Exp Date = {"<=$(=date(today()-3))"}]>}Sales)

Should be this

Sum({<[Exp Date] = {"<=$(=date(today()-3))"}>}Sales)

adamdavi3s
Master
Master

sorry typing too quick, corrected it

Not applicable
Author

I have data after reload

 

Batch IdCampaign IdStart DateExp Date
21281717114/03/202314/02/2024
21789634317/08/202017/07/2021
22684569730/09/201930/08/2020
23984844205/12/202305/11/2024
24187497814/04/202214/03/2023

I want answer

 

Batch IdCampaign IdStart DateExp Date
22684569730/09/201930/08/2020
21789634317/08/202017/07/2021
24187497814/04/202214/03/2023
sunny_talwar
MVP
MVP

May be like this

Dimension

Batch Id

Campaign Id

Exp Date

Expression

Date(Only({<[Start Date] = {"$(='<=' & Date(Min([Start Date], 3), 'DD/MM/YYYY'))"}>} [Start Date]))

Updated the expression and attached a sample

Not applicable
Author

Thanks all of you ...