Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sivavasam
Contributor II
Contributor II

Help With Script ,sum of Distinct Charge

 

If extra person in room is child then charge is zero and remaining adult in room number charge should change to zero ,i need Sum(aggr(sum(distinct(charge )),room number .  as required  2nd table 

Screenshot (3).png

 

3 Replies
rubenmarin

Hi, I think the expression could be something like: Sum(Aggr(IF(Index(Concat(TOTAL <ROOM> AC),'CHILD'),0,Sum(DISTINCT CHARGE)),ROOM))

Maybe it need to add the condition for extra person.

For a room charge, it will be better to have it precalculated in script so the expression in the front end will be easier and give better performance.

sivavasam
Contributor II
Contributor II
Author

Any script level suggesion 

rubenmarin

Too few info. The objective would by to create a table by room (maybe by and id that identifies the reserve) and the charge associated to that reservation (maybe only for the extra person) so you only need a sum of this RoomCharge