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: 
andreacs
Contributor
Contributor

comparing values from dynamic fields (set analysis)

Hi,

I need to compare field values from two tables. Fields name could change so I need to use a variable approach to compare the fields dynamically.

DIMENSION: %field

EXPRESSION1: =only({1} %field)

EXPRESSION2: =COUNT(if($(='[NEW.'&%field&']')<>$(='[OLD.'&%field&']'),KEY))

The expression2 works fine if I select a value from %field but i would like to show the result for each fields (ignoring selections in %field).

I try something like this but it doesn't work:

EXPRESSION2: =COUNT(if($(='[NEW.'&only({1}%field)&']')<>$(='[OLD.'&only({1}%field)&']'),KEY))

please help me with this last expression

thank you!

*****************************************************

this is the script:

Qualify *;

Unqualify KEY;

OLD:

LOAD KEY,

     FIELD1,

     FIELD2,

     FIELD3,

     FIELD4

FROM

C:\OLDFILE.xlsx

(ooxml, embedded labels);

Unqualify *;

Qualify *;

Unqualify KEY;

NEW:

LOAD KEY,

     FIELD1,

     FIELD2,

     FIELD3,

     FIELD4

FROM

C:\NEWFILE.xlsx

(ooxml, embedded labels);

Unqualify *;

FIELD_NAME:

LOAD *

Inline "

%field_old_sel, %field_new_sel, %field

    [OLD.FIELD1], [NEW.FIELD1], FIELD1

    [OLD.FIELD2],[NEW.FIELD2],FIELD2

    [OLD.FIELD3],[NEW.FIELD3],FIELD3

    [OLD.FIELD4],[NEW.FIELD4],FIELD4

       

   ";

Labels (1)
0 Replies