Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

brijeshma
Contributor

How to get Start Date till End date in qliksense

Hi,

I have one date field [Inventory Date] . I want to keep Start date always as 01/01/2011 and End date should be date with

Customer select in list box for Inventory Date..

set vStart =  min(Inventory Posting Date]) //// Minimum date for Posting Date is 01/01/2011.

set vEnd =  Max(Inventory Posting Date])

Sum({< [Inventory Posting Date] = {'>=$(=Date(vStart))<=$(=Date(vEnd))'} >} [Item Ledger Entry Quantity])..

When User  Select Date from List box it should sum quantity from 01/01/2011 till selected Date.

Kinldy Help me on this.. Thanks in Advanced.

8 Replies
balrajahlawat
Esteemed Contributor

Re: How to get Start Date till End date in qliksense

what error you are getting?

syntax looks okay


Sum({< [Inventory Posting Date] = {'>=$(=Date(vStart))<=$(=Date(vEnd))'} >} [Item Ledger Entry Quantity])..


Also make sure both =Date(vStart)) and [Inventory Posting Date] should have same format

brijeshma
Contributor

Re: How to get Start Date till End date in qliksense

i m set ,

vStart = date('01/01/2011','DD/MM/YYYY')

VEnd = Max(date([Inventory Posting Date],'DD/MM/YYYY'))

while loading in script i m doing 

Date(Date,'DD/MM/YYYY') as [Inventory Posting Date]  ...

Still its not coming

balrajahlawat
Esteemed Contributor

Re: How to get Start Date till End date in qliksense

okay, try this, I guess at main code syntax of date is different

Remove Date() from exprssion with variable, try this:

Sum({< [Inventory Posting Date] = {'>=$(=vStart)<=$(=vEnd)'} >} [Item Ledger Entry Quantity])

brijeshma
Contributor

Re: How to get Start Date till End date in qliksense

hi Balraj ,

its not giving anything .. its giving '-'

balrajahlawat
Esteemed Contributor

Re: How to get Start Date till End date in qliksense

can you share sample data in excel?

balrajahlawat
Esteemed Contributor

Re: How to get Start Date till End date in qliksense

Also dont forget to bypass the fields like:

=Sum({<Year=,Month=,Day=,DateField=, [Inventory Posting Date] = {'>=$(=vStart)<=$(=vEnd)'} >} [Item Ledger Entry Quantity])


Hope this will help!!

Re: How to get Start Date till End date in qliksense

Make some change in your variable

vStart =Date(date#('01/01/2011','DD/MM/YYYY'),'DD/MM/YYYY')  //Here your date is not in date format check this

VEnd = Max(date([Inventory Posting Date],'DD/MM/YYYY'))

And then use

Sum({< [Inventory Posting Date] = {'>=$(=vStart)<=$(=vEnd)'} >} [Item Ledger Entry Quantity])

Regards

Anand

brijeshma
Contributor

Re: How to get Start Date till End date in qliksense

hi Anand,

Its Not working .. Any other Way...Thanks for ur reply..

Community Browser