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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count problem with 2 dates

Hello,

I have a question where not sure how to get the result and need your help !

I want count the items by the input_date and output_date in one bar graph. So that i can see  the difference per day between input and output. But it does not work.What am i doing wrong?


iteminput_dateoutput_date
101201.05.201304.05.2013
222104.05.201307.05.2013
221120.05.201201.06.2013
121201.05.201306.05.2013
453203.05.201305.03.2013
433201.05.201304.05.2013
787604.05.201306.05.2013

Thanks a lot!

Kai

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Kai, create a canonical date from your two date fields

Canonical Date

Then use this new field as dimension and your DateType field as second dimension.

Expression

=Count(DISTINCT DateType)

View solution in original post

6 Replies
swuehl
MVP
MVP

Not quite sure how your analysis works. Do you want to show a kind of histogram, with the difference between dates on x-axis?

Dimension

=Aggr( output_date - input_date, item)

Expression

=Count(Distinct item)

[take care that your dates have a numeric representation, e.g. by setting the default date format in the script to the fields date format]

Or do you want to see a bar per item, with the difference as height of the bar?

Dimension

=item

Expression

=( output_date - input_date)

Or just post your current QVW and your description of what you expect to see.

trdandamudi
Master II
Master II

Not clear on the requirement are you looking for this...(Please see the attachment)

maksim_senin
Partner - Creator III
Partner - Creator III

Hi Kai,

The solution really depends on what you need. If input and output dates are separate dates - the solution is simple (see below), if they define periods - the solution is a little bit tricky.

In case we deal with separate dates:

1. You need to build a calendar in your app with all the dates of the period (from min to max between input and output dates). At the same time the calendat should have one field, say DateId, which should be used for linking

2. Than you should link your data to the calendar so you'll be able to count the number of items per each date

In case we deal with periods it's necessary to like the data via IntervalMatch load.

Best regards,

Maxim

Not applicable
Author

Hello,

i would like count the items per date - e.g. 04.05.2013; 2 items on input_date and 2 items on output_date.

Like this, just right ;-(

image001.png

Maxim writes, it is determined on calendar.I suspect that even.


@Maxim: Can you further explain your example to me. I'm new on QlikView.


Thanks a lot!

Kai


swuehl
MVP
MVP

Kai, create a canonical date from your two date fields

Canonical Date

Then use this new field as dimension and your DateType field as second dimension.

Expression

=Count(DISTINCT DateType)

Not applicable
Author

Many thanks!