Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I count without clicking on a table?

Hello,

I have an Excel file containing five columns: day, month, day types, employees and number of hours worked by an employee.

Example:

Days | Month | Days type     | Duration (hours)   | Employees

1      | January | weekend      |       8                  | Gerard

1      | January | weekend      |       5                  | Kevin

2      | January | normal day   |       10                | George

2      | January | normal day   |        3                 | Kevin

So, on Qlikview, I have 5 tables (fields): Day, month, day type, Duration and Employees.

I would like to create a graph where you can see the sum of hours in weekends per month without selecting the field "weekend" in the table.

This is similar to an "if" in an excel ... but on Qlikview, I can not.

In the script, I try with this code:

if ([type days] = 'weekend', Sum (Duration))

But I have to click on the "weekend" to see the results ... How can I do without clicking?

or I try to count how many weekend there are? with : count([Days type]='weekend')      but it'll count each line where there is a weekend. However, there are 1 weekend for the day 1...     count([Days type]='weekend') and DISTINCT Days    ... don't work too...

Please help me. Sorry for my language, i'm french...

I hope I made ​​myself understood and thank you in advance

1 Solution

Accepted Solutions
Gysbert_Wassenaar

The brackets are ok, but the quotes aren't. See attached example. Is that the sort of thing you're looking for?


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
shree909
Partner - Specialist II
Partner - Specialist II

Hi if u want to show per month

aggr(sum{<day_type ={'Weekend"}>}duration),month)

Not applicable
Author

It doesn't work... there is a problem with brackets?

Gysbert_Wassenaar

The brackets are ok, but the quotes aren't. See attached example. Is that the sort of thing you're looking for?


talk is cheap, supply exceeds demand
Not applicable
Author

It works , thank you

But I must add Distinct for days because without distinct it counts 2 times the weekend for the day 1.

count({<[Days type]={'weekend'}>} DISTINCT Days)