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

Day - 1 not working

Hi,

I'm trying to add -1 day to my string variable varBeginDatum. 

But it result 0 .

SnapshotDate_Stock_In_Use is date type.

varBeginDatum is string.

sum({< SnapshotDate_Stock_In_Use = {"$(=date(varBeginDatum-1))"}>} Qty_Stock_In_Use)

 

Where do I wrong ?

Labels (1)
1 Solution

Accepted Solutions
Yedikapi
Contributor II
Contributor II
Author

I've done following which has worked !

sum({< SnapshotDate_Stock_In_Use = {"$(=date(varBeginDatum-1,'YYYY-MM-DD'))"}>} Qty_Stock_In_Use)

View solution in original post

3 Replies
marcus_sommer

Only numeric value could be calculated against each other, means you need to convert the string to a number, maybe with something like:

$(=date(date#(varBeginDatum, 'FormatPattern')-1))

- Marcus

Yedikapi
Contributor II
Contributor II
Author

It doesn't work for me .

I still get 0 as result.

Yedikapi
Contributor II
Contributor II
Author

I've done following which has worked !

sum({< SnapshotDate_Stock_In_Use = {"$(=date(varBeginDatum-1,'YYYY-MM-DD'))"}>} Qty_Stock_In_Use)