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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Condtion Problem.Need a solution as soon as Possible

Hi

I m having a problem in writing a macro here.I have two variables name My Budget and Total Sale.In Mybudget i have assign it a value 8000.and in totalSale the value is 69950(sum of some expression).then i use a two msg box to show each value .it is showing the right value.then i use a conditon that if the value of total sale which is 69950 is less than 8000 then show a msg box which says my sales are less else msg box show that my Sales are greater.The right answere is that it has to show my sales are greater but it is showing My sales are lesss.i dont know y ....here is my Script





Sub

ShowPoPUp

set

if

MsgBox

MsgBox

("MySales are greater than 8000")

end

if

end

Sub ("MySales are less than 8000")

else

(v.getcontent. string) < (a.getcontent. string) then a=ActiveDocument.Variables("MyBudget")

set

v=ActiveDocument.Variables("TotalSale")

Msgbox

(a.getcontent. string)

Msgbox

(v.getcontent. string)





Regards

Sikandar

1 Solution

Accepted Solutions
amars
Specialist
Specialist

Hi sikandar,

try & paste your macro once again. First paste it in notepad & then paste it in the Post , direct copy paste doesn't paste the content properly. From the little bit I could understand , try & use CINT(stringvalue) instead of using the string value of the expression. It will not give the required input.

e.g. Msgbox CINT("1000")<CINT("2000")

See if it help.

Regards

Amar

View solution in original post

2 Replies
amars
Specialist
Specialist

Hi sikandar,

try & paste your macro once again. First paste it in notepad & then paste it in the Post , direct copy paste doesn't paste the content properly. From the little bit I could understand , try & use CINT(stringvalue) instead of using the string value of the expression. It will not give the required input.

e.g. Msgbox CINT("1000")<CINT("2000")

See if it help.

Regards

Amar

Not applicable
Author

Hi amras

Armas the solution you gave worked,Thank you sooo much

Regrds

Sikandar