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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Saro_2306
Contributor II
Contributor II

Dual total in YTD

Hi All,

I need to combine below 2 formulae as one formulae for calculation Target (i.e Target = Prod Units / Working Days). it should be shown in Bar chart with dimension User Name. 

For all users Target should be same. 

sum({<[Week Num]={">=$(=(week(Yearstart(Max([Week Num]))))) <=$(=Max([Week Num]))"}>} TOTAL<Desk>[Production Units]) ,

sum({<[Week Num]={">=$(=(week(Yearstart(Max([Week Num]))))) <=$(=Max([Week Num]))"}>} TOTAL<Desk>[Working Days Count])

Need your help. Thanks in advance.

 

Labels (1)
8 Replies
agigliotti

Hi @Saro_2306 ,

Maybe this:
=sum( {< [Week Num] = {">=$(=(week(Yearstart(Max([Week Num])))))<=$(=Max([Week Num]))"}>} TOTAL<Desk> [Production Units]/[Working Days Count] )

I hope it can help.

Best Regards

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
Saro_2306
Contributor II
Contributor II
Author

@agigliotti  Not working

agigliotti

why do you need a total for <Desc> field ?

if you have the user name as dimension and the result is the same for all users, try the below:

=sum( {< [Week Num] = {">=$(=(week(Yearstart(Max([Week Num])))))<=$(=Max([Week Num]))"}>} TOTAL [Production Units]/[Working Days Count] )

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
Saro_2306
Contributor II
Contributor II
Author

I am having set data of 4 teams and 4 weeks. I need to add target of particular team. So i had used TOTAL. 

agigliotti

could you explain what is your actual result and the expected one?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
Saro_2306
Contributor II
Contributor II
Author

@agigliotti  My expected result and sample data details are available in attached excel sheet

agigliotti

you can use this script:

a:
LOAD [Week Num],
[Team Name],
[User Name],
[Production Units],
[Working Days]
FROM
[C:\Users\Andrea\Downloads\Example Data.xlsx]
(ooxml, embedded labels, table is dati);

b:
load *,
if( [Team Name] = Previous([Team Name]), Target+Previous(TargetACC), Target ) as TargetNEW;
load *,
if( [Team Name] = Previous([Team Name]), Target+Previous(Target), Target ) as TargetACC;
load
[Team Name],
[Week Num],
sum([Production Units])/sum([Working Days]) as Target
Resident a Group by [Team Name],[Week Num] Order by [Team Name],[Week Num];

left join(b)
LOAD [Week Num],
[Team Name],
[User Name] Resident a;

drop Tables a;

finally your target is TargetNEW.

 

agigliotti_0-1614093051063.png

 

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
Saro_2306
Contributor II
Contributor II
Author

Dear @agigliotti  thanks for your effort. but given data is not my source data. Production units and Working days count are derived by sum() expression. I need set analysis for to get desired output and should be shown in bar chart.