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: 
wenkew186
Creator
Creator

How to write Expressin

Hi Guys,

I have a pivot table. like attachment.  2 dim and one expression.

Column "Cluster count of Subregion" just for compare. it means how many Custer belong to the Sub region.

Expression Logic is : Sum(Value)/Sum(DayNum)

Requirement point is :

    when "Cluster count of Subregion" >1, the Expression result it should be  every Cluster's Sum(Value)/Sum(DayNm)  add.

    when "Cluster count of Subregion" =1 or 0, the Expression result is Sum(Value)/Sum(DayNum).

The background of the question:

because data source is excel file. and the Subregion data is added by every (Cluster data /DayNum) if have Cluster.

like:

Sum({<Subregion='Subregion1'>}Value) /Sum({<Subregion='Subregion1'>}DayNum)

<>

Sum({<Cluster='Cluster1'>} Value)/Sum({<Cluster='Cluster1'>}DayNum)

+Sum({<Cluster='Cluster2'>} Value)/Sum({<Cluster='Cluster2'>}DayNum)

+Sum({<Cluster='Cluster3'>} Value)/Sum({<Cluster='Cluster3'>}DayNum)

+Sum({<Cluster='Cluster4'>} Value)/Sum({<Cluster='Cluster4'>}DayNum)

......................................

Question:    How to write the Expression ?

Please help ?

thanks,

Kevin.

Labels (1)
11 Replies
ramoncova06
Partner - Specialist III
Partner - Specialist III

you don't have to write it that way

the total <subregion> will give you sum grouped by subregion

wenkew186
Creator
Creator
Author

Hi suninda,

yes, it is works good for my case, it's a great help for me.thank you so much.