Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone
I have a some data as date range (e.g. "2-Apr-09 ~ 6-May-09), I need to allocate the days (i.e. 32days) and distribute to the month accordingly. (e.g. Apr is 29days and May is 5days)
I have an no ideas how to treat it using syntax / script?
Can anyone help me!
Thanks in advance.
Hi,
This calculating should be in the script.
For calculating the number of days between the two dates you can use:
INTERVAL ( DATE ( [6-may-09] , 'D-MMM-YY' ) - DATE ( [2-apr-09] , 'D-MMM-YY' ) , 'D' ) AS DiffDays (formatting your date fields with the DATE function might be necessary to make a correct comparison)
For your second question you could do something like this:
INTERVAL ( MONTHEND([2-apr-09]) - [2-apr-09] ) AS DaysToMonth1,
INTERVAL ( MONTHSTART([6-may-09] ) - [2-apr-09] ) AS DaysToMonth2,
You may need to apply some dateformatting to your datefields, if they differ from each other..
Hope this helps!
Regards, Sander
Hi
Use Interval function in Scripting(Load).
Use qlikview help in Interval then u get exactly??????
Hi
Can you please further elaborate as I would like to show in table format as per attached.
Is it possible to do it like this?
Thanks in advance.
For a specific example that matches your question, see the QV Cookbook sample "Count days in a transaction using IntervalMatch". You can download the QV Cookbook from:
http://robwunderlich.com/Download.html
-Rob
Hi Plz find that attachements.
I think it ll solve ur problem. Anything need tell me!!