mavmanau
asked on
XSLT SUM IF example
Hi,
Thank you for taking the time to look at my question.
Essentially I have the following XSL:
<clientdemo><transaction>< account>16 </account> <tr_to_age ncy>-2808. 6</tr_to_a gency><tr_ to_client> 0</tr_to_c lient><tr_ payment_da te>2009020 2</tr_paym ent_date>< Client_row _id>1</Cli ent_row_id ><tr_liste d_date>200 91128</tr_ listed_dat e></transa ction>
<transaction><account>1</a ccount><tr _to_agency >750</tr_t o_agency>< tr_to_clie nt>0</tr_t o_client>< tr_payment _date>2010 0505</tr_p ayment_dat e><Client_ row_id>1</ Client_row _id><tr_li sted_date> 20091128</ tr_listed_ date></tra nsaction>
<transaction><account>1</a ccount><tr _to_agency >0</tr_to_ agency><tr _to_client >250</tr_t o_client>< tr_payment _date>2010 0527</tr_p ayment_dat e><Client_ row_id>1</ Client_row _id><tr_li sted_date> 20091128</ tr_listed_ date></tra nsaction>
<transaction><account>1</a ccount><tr _to_agency >1200</tr_ to_agency> <tr_to_cli ent>0</tr_ to_client> <tr_paymen t_date>201 00712</tr_ payment_da te><Client _row_id>1< /Client_ro w_id><tr_l isted_date >20091128< /tr_listed _date></tr ansaction>
<transaction><account>1</a ccount><tr _to_agency >100</tr_t o_agency>< tr_to_clie nt>0</tr_t o_client>< tr_payment _date>2010 0909</tr_p ayment_dat e><Client_ row_id>1</ Client_row _id><tr_li sted_date> 20091128</ tr_listed_ date></tra nsaction>
<transaction><account>16</ account><t r_to_agenc y>-35.8</t r_to_agenc y><tr_to_c lient>0</t r_to_clien t><tr_paym ent_date>2 0100529</t r_payment_ date><Clie nt_row_id> 1</Client_ row_id><tr _listed_da te>2010070 3</tr_list ed_date></ transactio n>
<transaction><account>16</ account><t r_to_agenc y>-1000</t r_to_agenc y><tr_to_c lient>0</t r_to_clien t><tr_paym ent_date>2 0090330</t r_payment_ date><Clie nt_row_id> 1</Client_ row_id><tr _listed_da te>2009123 0</tr_list ed_date></ transactio n>
</clientdemo>
and what I want to do is if account=16 and trpaymentdate > 20091231 and trpaymentdate is <=20100131 sum of all tr_toagency and sum of all tr_to_client and then sum these two figures together.
Could someone please help with how the XSLT sheet would look? Once I see how you go about that I can then fill in what I need to.
Many thank you's in advance.
Thank you for taking the time to look at my question.
Essentially I have the following XSL:
<clientdemo><transaction><
<transaction><account>1</a
<transaction><account>1</a
<transaction><account>1</a
<transaction><account>1</a
<transaction><account>16</
<transaction><account>16</
</clientdemo>
and what I want to do is if account=16 and trpaymentdate > 20091231 and trpaymentdate is <=20100131 sum of all tr_toagency and sum of all tr_to_client and then sum these two figures together.
Could someone please help with how the XSLT sheet would look? Once I see how you go about that I can then fill in what I need to.
Many thank you's in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
that works perfect though, the first part you have given me.
ASKER
Thank you!! very appreciative, very quickly done too!!
You welcome. So, did you figure out how to feed an input id value?
ASKER
i think so...I am trying at the moment!
ASKER