Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

comparing varibales

Hi experts,

I do have four variables which I created in UI based on complex logic, now I need to get unique count of unique values of the combined data values in variables, can you please help.

example sample data,consider below four variables A,B,C,D which i created in UI having below values, how do i get unqiue count which is 9.

Please help.

    

ABCD
A1A1B1C1
A2B1C1D1
A3B2C2D2
2 Replies
Gysbert_Wassenaar

Can you post a qlikview document that demonstrates the problem?


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,please see below example

CompanyProduct IdBusiness dateGrade 1Grade 2Grade 3
MicrosoftA1236/29/2015101010
MicrosoftA1236/28/20159910
MicrosoftA4566/29/2015101010
MicrosoftA4566/28/2015101011
MicrosoftA7896/29/2015131212
MicrosoftA7896/29/2015121212
DukeB1236/28/201591213
DukeB1236/29/201591214
EdisonB4566/28/2015111313
EdisonB7896/29/20159912
EdisonB7896/28/201510109

logic for upgrades: if difference of previous grade-current grade>0, then upgrade

logic for downgrades: if difference of previous grade-current grade<0, then downgrade


as you can see in above example prod A123 of microsoft has been upgraded in both grade 1 and grade 2 and in grade 3 its unchanged,

so, if the product has been upgraded in at least one of grades it should count as only 1 upgrade, so in total Microsoft has two upgraded products A123(in grade 1 and grade2) and A 789, hence count is 2 and for Duke product has been downgraded in grade 3.

so, I created separate variables for each grade to get Product id for Product Upgrades and downgrades, now i need o/p table as below o/p table should be

 

CompanyTotal UpgradesTotal Downgrades
Microsoft21
Duke01
Edison11

since I created variables for each Grade, i need to show unique product ids for upgrades and downgrades for each company. any ideas. please help.