Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QlikView not filtering data properly

Hello,

I have the following tables

qvtables.png

The table Metrics is a result of concatenating two separate tables that count the number of tickets opened and closed.

OpenTickets:

Load

count(monthopened) as numopen,

monthopened as [Year-Month]

Resident Table1

GROUP BY monthopened;

ClosedTickets:

Load

count(monthresolved) as numclosed,

monthresolved as [Year-Month]

Resident Table1

GROUP BY monthresolved;

Metrics:

NoConcatenate

load *

resident ClosedTickets;

CONCATENATE

load *

resident OpenTickets;

DROP TABLE ClosedTickets;

DROP TABLE OpenTickets;

The fields monthresolved and monthopened are available in Table1 and they match the format of the Year-Month field in the MasterCalendar. The MasterCalendar is generated using qvc.calendarfromfield.

I put the content of table Metrics in a straight table, where dimension is Year-Month and expressions are SUM of numclosed and numopened. My problem is that whenever I filter the data using any field in Table1, the straight table blanks out, which seems to me a problem in the relation between the two tables.

qvtableerr.png

Anything you suggest to solve this issue?

Thank you very much

10 Replies
Not applicable
Author

Appreciate any feedback.

Thank you

marcus_sommer

Yes it looked that there are no always proper associations between the tables respectively between the data-fields within your Table1. If there are no massive problems with the performance I wouldn't pre-calculate this within the script and just using a count-function within the chart-objects - and are there any performance issues you need to consider more factors on the datamodel to improve the performance.

- Marcus

Not applicable
Author

Hello marcus_sommer,

Thanks for your reply.

My initial solution involved counting within the chart object. The problem is with the x-axis.

When I plot 1 line for count of opened cases (ex count [Ticket Id]), and 1 line for count of closed cases (ex. count of [Date Resolved], or count [Ticket Id] when [Date Resolved] is not empty), while the x-axis is using the case [Creation Date], the count of closed cases is not showing correct values as it is using a wrong date.

Not applicable
Author

Kind reminder.

marcus_sommer

The format of Year-Month is the same in Metrics and within the Master-Calendar but are also the values there the same? The matching will happens on the numerical/string values and not on the formattings and if one is numeric and the other is a string or one is a date and the other is a timestamp it won't match.

- Marcus

Not applicable
Author

Hello Marcus,

So I am reading the data from a XLS sheet, while doing that, I am converting some strings into date and then into a specific format.

RawData:

LOAD [Ticket Id],

[...]

   Date(date#([Created Time], 'YYYY-MM-DD hh:mm:ss'), 'YYYY-MM-DD') as [Created Date],

   Date(date#([Resolved Time], 'YYYY-MM-DD hh:mm:ss'), 'YYYY-MM-DD') as [Resolved Date],

[...]

     Date(Floor(MonthEnd([Created Time])),'YYYY-MMM') as monthopened,

     Date(Floor(MonthEnd([Resolved Time])),'YYYY-MMM') as monthresolved

FROM

file.xls

[...]

I also tried it this way as I am assuming Master-Calendar has Year-Month as a string.

     Text(Date(Floor(MonthEnd([Created Time])),'YYYY-MMM')) as monthopened,

     Text(Date(Floor(MonthEnd([Resolved Time])),'YYYY-MMM')) as monthresolved

Thanks

jonathandienst
Partner - Champion III
Partner - Champion III

The script for date and Year-Month in Table1 and MasterCalendar respectively may be more helpful.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
marcus_sommer

I'm not sure but I think that your values are further different. I believe the easiest way to find those differences and to create valid keys would be to remove any formattings from the KEY's - this meant to create keys which are only serving the purpose to be a key to associate the tables and within the UI you used additional fields (which then are formatted like you want).

- Marcus

Not applicable
Author

Hello,


The MasterCalendar is generated using the following QVC

$(Include=qvc.qvs)

call qvc.calendarfromfield('date');

call Qvc.Cleanup;

I am putting the script together here below

Table1:

LOAD [Ticket Id],

  [...]

    date(date#([Created Time], 'YYYY-MM-DD hh:mm:ss'), 'YYYY-MM-DD') as [Created Date],

    date(date#([Resolved Time], 'YYYY-MM-DD hh:mm:ss'), 'YYYY-MM-DD') as [Resolved Date],

[...]

    Date(Floor([Created Time]),'YYYY-MM-DD') as date,

    Date(Floor(MonthEnd([Created Time])),'YYYY-MMM') as monthopened,

    Date(Floor(MonthEnd([Resolved Time])),'YYYY-MMM') as monthresolved

FROM

[file.xls]

(biff, embedded labels);

$(Include=qvc.qvs)

call qvc.calendarfromfield('date');

call Qvc.Cleanup;

OpenTickets:

Load

count(monthopened) as numopen,

monthopened as [Year-Month]

Resident Table1

GROUP BY monthopened;

ClosedTickets:

Load

count(monthresolved) as numclosed,

monthresolved as [Year-Month]

Resident Table1

GROUP BY monthresolved;

Metrics:

NoConcatenate

load *

resident ClosedTickets;

CONCATENATE

load *

resident OpenTickets;

DROP TABLE ClosedTickets;

DROP TABLE OpenTickets;