9 Replies Latest reply: Feb 15, 2016 4:51 AM by V SUDHAKAR

# How to show the Difference

Hi friends,

I wanna show the diff b/w two values dynamically. I've 4 expression and one more expression for Difference using in Ad-hoc concept.

when I select any two exp from that 4 it show the Diff b/w that 2 exp in the same table. based on current selection only it should show

For Example

if I've Exp like below,

%Expression

Total Sales-14,  //(Sum TSales-14)

Total Sales-15, //(Sum TSales-15)

Sales-14,         //(Sum Sales-14)

Sales-15,        //(Sum Sales-15)

Diff                 //(???????????????)

for Diff I don't know what kind of exp I 've to try..

User can select any 2 dimension to know the Diff. So I need that exp as Dynamically (Based on User current Selected Expressions)

Thanks

Abinesh S

• ###### Re: How to show the Difference

Try like this?

=(Sum TSales-14) - (Sum TSales-15)  as per your requirement

• ###### Re: How to show the Difference

I need that exp dynamically.... In your exp it show only Diff b/w 14 &15 Total sales only but In user point of view they will select any exp like "TSale-14 - Sale-15" or "Sale-14 -TSale-15" So I need that Diff exp completely based on user selection only...

• ###### Re: How to show the Difference

If your 2 expressions are dynamically selected, you could write your difference like that:

= Column(2) - Column(1)

• ###### Re: How to show the Difference

Thanks Sebastien its work properly.. Thank you very much. And one more doubt when I select the exp in adhoc it sort the exp by values but I wanna sort the exp by user selection wise.

For eg:

Sales=1000

Target=1100

User select the Target 1st and the select sales 2nd and check the diff in that time in qlik view it show "-100" based on values it sorting itself....  guys help on this also

• ###### Re: How to show the Difference

Guys thanks to all of you I got the solution for my 2nd query also...