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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
HAmzehAF
Partner - Creator
Partner - Creator

Date

Hello, 

so im trying to do a stock control sheet and to get that i want a bar chart with today stock and -30 days stock 

bu everytime i try to get the -30 days stock i keeps giving me the whole stock i have 
my set analysis for this is : 
Sum({<Date = {"<$(=Date(Today() - 30))"}>} Stock * WAC)

also i tried to do it in the data load as
IF(Date = Date(Today() - 30), 1, 0) AS Is30DaysAgo,


im i doing smothing wrong cuz i tried like everything i only get 0 or the all stock, i just want to get the stock before 30 days for any of the dates i have when the user pick on it will go to that date 

 

22 Replies
HAmzehAF
Partner - Creator
Partner - Creator
Author

anyhelp?

BrunPierre
Partner - Master II
Partner - Master II

Try this

=Sum({$<Date = {"<=$(=Date(Today()-30)))"} >} Stock * WAC)

HAmzehAF
Partner - Creator
Partner - Creator
Author

thank you for the reply but still im getting 0 when i use this ,
i tried to just check the date before 30 days to see if i have data and yes i do but i get 0 

BrunPierre
Partner - Master II
Partner - Master II

Maybe trying with the appropriate date format.

=Sum({$<Date = {"<=$(=Date(Today()-30,'DD/MM/YY')))"} >} Stock * WAC)

Kaushik2020
Creator III
Creator III

Try to replace date something like below, 

Date={">=$(=Date(AddMonths(max(Date),-1)))<=$(=Date(max(Date)))"}>}

 

Complete expression:

Sum({<Date={">=$(=Date(AddMonths(max(Date),-1)))<=$(=Date(max(Date)))"}>}

Stock * WAC)

MeehyeOh
Partner - Creator
Partner - Creator

Hi, @HAmzehAF 

I think it might be different date format between two field.

What is [Date] field date format?

HAmzehAF
Partner - Creator
Partner - Creator
Author

hello everyone thank you, 
but still nothing is working 

date is like this , 10/25/2023

 

 

Vegar
MVP
MVP

In order to do larger than or smaller than comparisons your date field needs to be recognised as a date (that is having a numeric underlying value).

It could be that your dollar expansion result is interpreted as an expression, eg 2023-10-09 can be interpreted as equal to 2004 and not the date value. Try this 

Sum({<Date = {"<'$(=Date(Today() - 30))'"}>} Stock * WAC)

OR

Sum({<Date = {"<$(=num(Today() - 30))"}>} Stock * WAC)

 

HAmzehAF
Partner - Creator
Partner - Creator
Author

HAmzehAF_0-1699512621717.pngHAmzehAF_1-1699512634368.pngHAmzehAF_2-1699512646516.png

still nothing ,
when i use this i get the max date and works fine 
Sum({<Date={"$(=max(Date))"}>}Stock*WAC)

@Vegar