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: 
vipin_mishra479
Creator II
Creator II

Script problem

I  have given a some script part in this script i have using a group by function and this function + , - are working but when i try to divide two fied is not working

i have attached the  script in docx.

Labels (1)
7 Replies
sreenivas
Creator III
Creator III

In this script there is no division

Anonymous
Not applicable

sreenivas is correct - you have not posted the part which you are saying is not working..

anyways.. are you trying to say that the division script is not working if you try in a similar fashion like the below..

sum(if(DESCRIPTION2='Sales',Amount))* sum(if(DESCRIPTION2='COGS',Amount)) as Amount,

sum(if(DESCRIPTION2='Sales',Amount))/ sum(if(DESCRIPTION2='COGS',Amount)) as Amount,

can also post what happens when you try to divide..

vipin_mishra479
Creator II
Creator II
Author

but when i divide by 2 its working.

vipin_mishra479
Creator II
Creator II
Author

thanks for the reply

but when i divide or multiply the out put is blank.

Anonymous
Not applicable

well.. i can suggest you run a check first on the data..

create a script like the below, put a table of the three fields and then check all the three fields...

sum(if(DESCRIPTION2='Sales',Amount))* sum(if(DESCRIPTION2='COGS',Amount)) as Amount,

sum(if(DESCRIPTION2='Sales',Amount)) as SalesAmount,

sum(if(DESCRIPTION2='COGS',Amount)) as COGSAmount,

vipin_mishra479
Creator II
Creator II
Author

salesAmount and CogsAmount are come correct but Amount comes are wrong.

sreenivas
Creator III
Creator III

Check this file