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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

multiplying values by percentage

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?

15 Replies
MarcoWedel

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

];

QlikCommunity_Thread_121684_Pic1.JPG.jpg

QlikCommunity_Thread_121684_Pic2.JPG.jpg

QlikCommunity_Thread_121684_Pic3.JPG.jpg

QlikCommunity_Thread_121684_Pic4.JPG.jpg

hope this helps

regards

Marco

Not applicable
Author

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.

MarcoWedel

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%

];

QlikCommunity_Thread_121684_Pic5.JPG.jpg

regards

Marco

Not applicable
Author

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)

MarcoWedel

no, this '2' defines the number of columns before the ratioX columns, here: Month and Group.

regards

Marco

Not applicable
Author

Thanks, it worked.