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

How to use "if" and compare it with the calculated data in a different column

I have the below data

GradeNameMoney1 (Will not change)Money2Category
AVice President1000011000(if variance% between money1 & 2 is <20%, then show the value)
BDelivery Head1500013000(if variance% between money1 & 2 is <20%, then show the value)
COperations Manager1800019000(if variance% between money1 & 2 is <20%, then show the value)

The column Money1 will not change, the column money 2 will be picked up from the raw data and compared against the column "Grade".

I want to calculate if variance% between money1 & 2 is <20% for each of the grade and then the category should the value %)

4 Replies
Anil_Babu_Samineni

We've got like below

Capture.PNG

In your example, I don't think which value we need to pick condition is fulfillment. Would you explain little more

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Hi Anil, in the dataset, I have a column which has the actual package offered, i want to compare it to the column 'Money1' and see the variance. If the variance is >20%, the category should show as '>20%' else it should show '<20%'

Anil_Babu_Samineni

You can do like below

I assume, you may have Variance column with you for Column(3)

The condition should be like below

Sum(Aggr(If(Column(1) = Column(3) or Column(3) >= '0.2', '>=20%', '<20%'), Grade, Name))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
passionate
Specialist
Specialist

Hi Swamy,

Do the above calculation in load script itself:

LOAD Grade,

     Name,

     Money1,

     Money2,

    If(((Money2-Money1)/Money2)*100 < 20,((Money2-Money1)/Money2)*100 ) as Percentage

FROM

(ooxml, embedded labels, table is Sheet1);

Regards,

Pankaj