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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable usage in 'Inventory on hand' on the date

Hello, my dear friends!

I need your help!

I'm creating report 'Inventory on hand' on selected date.

How can I create calculating expressions (query) sum(qty) < @date ?

First of all I created

1. chart (Pivot table) with columns ItemGroup, Item, QTY

2. Object Calendar

3. Variable vDate

Can I create Expression in Chart sum(QTY) having Restriction by date?

I have other idea. May be insert Restriction by date in sql statement in Script like

SQL Select ItemID, transDate from Inventtrans where transDate < @vDate?

I'm waiting your advice!

Thank, my dear friends



1 Reply
Miguel_Angel_Baeyens


oleg_evt1970 wrote:How can I create calculating expressions (query) sum(qty) < @date ?


Hello Oleg,

I'd do as follows:

sum({< date = {'<$(vDate)'} }> qty)


Where vDate is a previously created variable populated with the date you want to use in the chart.


oleg_evt1970 wrote:SQL Select ItemID, transDate from Inventtrans where transDate < @vDate?


Actually you can do that as well

LET vDate = Date('01/01/2009'); // Example Table:LOAD *;SQL SELECT ItemID, transDateFROM Inventtrans WHERE transDate < $(vDate);


Hope that helps!