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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Expression Help ???

Hi Folks,

I need help in below logic.

I'm having shift wise stacked bar chart which is showing "Pieces Produced" across 3 shifts , like below:

Dim : 1. Date

         2. Shift_Name

Expression:

Pieces Produced : =num(Count(DISTINCT  Serial))

Now I have to calculate "Total Pieces Produced " and the logic for this should be :

TOTAL PIECES PRODUCED = Above Calculation of Pieces Produced + [NO CAQ SCRAP FLAG]


So condition for [NO CAQ SCRAP FLAG] is vNScrapFlag =SUM( {$<Type_Name = {'Scrap'},Production = {'NoCAQ'}>} Quantity)


I'm trying below expression to achieve Total Pieces , but it not working as expected :


=num(Count(DISTINCT  Serial)) + vNScrapFlag


See below:



As you can see above in Scrap Produced graph , we are having count "2" in Spat shift and "16" in Nacht Shift , so in bar chart of Total Pieces Produced it should add 2 to 243 Spat shift and 16 to 302 Nacht Shift.


By using =num(Count(DISTINCT  Serial)) + vNScrapFlag , it is adding "18" to all the shifts which is wrong. The correct Output should be as marked in yellow circle.


I hope I'n clear here!


Please suggest how I can achieve this.


Attached is demo qvw.


Thanks,

AS

Labels (1)
10 Replies
amit_saini
Master III
Master III
Author

Your Welcome!

Thanks,

AS