Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to figure out how I can multiply a value by different set of percentages which are in the tables. Can somebody help?
Hi Dennis,
maybe using a crosstable load of your ratio table?:
table1:
CrossTable (ratioType, ratio, 2)
LOAD * INLINE [
Month, Group, ratio1, ratio2
Jan, A, 50%, 60%
Jan, B, 50%, 40%
Feb, A, 55%, 70%
Feb, B, 45%, 30%
];
table2:
LOAD * INLINE [
Month, Group, value1, value2
Jan, A, 1234, 4321
Jan, B, 2345, 5432
Feb, A, 3456, 6543
Feb, B, 4567, 7654
];




hope this helps
regards
Marco
Hi,
Try those expresions:
Num(
value1 * (Num(PurgeChar(ratio1,'%'))/100)
,'#,##.0.0%; -#,##.0.0%')
and
Num(
value1 * (Num(PurgeChar(ratio2,'%'))/100)
,'#,##.0.0%; -#,##.0.0%')
best regards.
or with some more ratios:
table1:
CrossTable (ratioType, ratio, 2)
LOAD * INLINE [
Month, Group, ratio1, ratio2, ratio3, ratio4
Jan, A, 50%, 60%, 45%, 65%
Jan, B, 50%, 40%, 70%, 85%
Feb, A, 55%, 70%, 15%, 35%
Feb, B, 45%, 30%, 25%, 90%
];

regards
Marco
This looks like what I'm looking for. Let me try it. Is the '2' the number of ratios defined in
CrossTable (ratioType, ratio, 2)
no, this '2' defines the number of columns before the ratioX columns, here: Month and Group.
regards
Marco
Thanks, it worked.