Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
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
MVP & Luminary
MVP & Luminary

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)