Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2023, a live, in-person thrill ride. April 17 - 20, 2023, in Las Vegas! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expression to ignore dimensions

I am trying to write an expression that will ignore the dimensions on the graph but will apply the same amount to each dimension.

I have a list of names and the hours which they have worked. I would like to apply a share of 2 hours to each employee that has worked. This share should be applied daily and the number of employees working might change.

For example - I have Date, Name Fields

Day1

Person 1 - works 5 hours + share of 1 hour

Person 2 - works 6 hours + share of 1 hour

Day 2

Person 1 - works 4 hours + share of 30mins

Person 2 - works 6 hours + share of 30mins

Person 3 - works 4 hours + share of 30mins

Person 4 - works 5 hours + share of 30mins


How can I write this formula, either in the script or as part of the expression? Remembering that the user may decide to filter on day 1 and day 2 at the same time.

A graph selecting day 1 and 2 would show:

Person 1 - worked 9 hours + share of 1 hour 30 mins

Person 2 - worked 12 hours + share of 1 hour 30 mins

Person 3 - worked 4 hours + share of 30 mins

Person 4 - worked 5 hours + share of 30 mins

Many thanks

3 Replies
Clever_Anjos
Employee
Employee

It would be easier if you post some data or qvw as example

MarcoWedel

Hi,

one solution could be:

QlikCommunity_Thread_136719_Pic1.JPG.jpg

SET vTotalShare = Interval#('02', 'hh');

tabData:

LOAD * Inline [

Day, Person, Work

1,1,05:00

1,2,06:00

2,1,04:00

2,2,06:00

2,3,04:00

2,4,05:00

];

Left Join

LOAD Day,

     Interval($(vTotalShare)/Count(DISTINCT Person)) as Share

Resident tabData

Group By Day;

hope this helps

regards

Marco

Not applicable
Author

Some test data here - sorry

I would want to add a share of 2 hours to the people that worked on the 5 days given on the graph. The share would be depended upon who has worked on which day.